Skip to content

Commit

Permalink
Remove remaining account enumeration on login page.
Browse files Browse the repository at this point in the history
  • Loading branch information
corentin-soriano committed Nov 22, 2024
1 parent 77afd7a commit 5302a46
Show file tree
Hide file tree
Showing 26 changed files with 6 additions and 31 deletions.
6 changes: 1 addition & 5 deletions includes/core/login.js.php
Original file line number Diff line number Diff line change
Expand Up @@ -627,11 +627,7 @@ function launchIdentify(isDuo, redirect, psk, oauth2 = false) {
//TODO : je pense que cela pourrait etre modifié pour ne pas faire de requete ajax ; on dispose des infos via `get_teampass_settings`
$.post(
'sources/identify.php', {
type: 'get2FAMethods',
login: $('#login').val(),
xhrFields: {
withCredentials: true
}
type: 'get2FAMethods'
},
function(data) {
data = JSON.parse(data);
Expand Down
1 change: 0 additions & 1 deletion includes/language/bulgarian.php
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
Expand Down
1 change: 0 additions & 1 deletion includes/language/catalan.php
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
Expand Down
1 change: 0 additions & 1 deletion includes/language/chinese.php
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
Expand Down
1 change: 0 additions & 1 deletion includes/language/czech.php
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
Expand Down
1 change: 0 additions & 1 deletion includes/language/dutch.php
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
Expand Down
1 change: 0 additions & 1 deletion includes/language/english.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
'highlight_selected_tip' => 'When enabled, the selected item will be highlighted in the list.',
'highlight_favorites' => 'Highlight favorites',
'highlight_favorites_tip' => 'When enabled, the favorite items will be highlighted in the list.',
'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'oauth2_need_user_old_password' => 'For the first SSO connection, please provide your previous password',
Expand Down
1 change: 0 additions & 1 deletion includes/language/estonian.php
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
Expand Down
1 change: 0 additions & 1 deletion includes/language/french.php
Original file line number Diff line number Diff line change
Expand Up @@ -1189,7 +1189,6 @@
'show_item_data_tip' => 'Permet d'afficher des informations supplémentaires dans la liste des éléments (nom d'utilisateur, e-mail et URL). Cela peut être utile pour avoir un aperçu rapide du contenu de l'élément.',
'items_page_split_view_mode' => 'Afficher le détail d'un objet sur la page des objets',
'replace_tenant_id' => 'Adapter l'url tout en laissant {tenant-id}. Il sera remplacer lors de l'appel.',
'user_exists_but_not_oauth2' => 'Vous devez vous authentifier avec votre compte Azure/Entra AD',
'user_not_allowed_to_auth_to_teampass_app' => 'Vous n'êtes pas autoriser à vous authentifier à l'application Teampass',
'user_is_not_auth_with_oauth2' => 'Vous ne pouvez pas vous authentifier avec un compte Entra/Azure AD',
'highlight_favorites' => 'Mettre en évidence les favoris',
Expand Down
1 change: 0 additions & 1 deletion includes/language/german.php
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Zeigt zusätzliche Informationen in der Eintragsliste an (Benutzername, E-Mail, URL). Dies erlaubt einen schnellen Überblick über den Inhalt der Einträge.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
Expand Down
1 change: 0 additions & 1 deletion includes/language/greek.php
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
Expand Down
1 change: 0 additions & 1 deletion includes/language/hungarian.php
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
Expand Down
1 change: 0 additions & 1 deletion includes/language/italian.php
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
Expand Down
1 change: 0 additions & 1 deletion includes/language/japanese.php
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
Expand Down
1 change: 0 additions & 1 deletion includes/language/norwegian.php
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
Expand Down
1 change: 0 additions & 1 deletion includes/language/polish.php
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
Expand Down
1 change: 0 additions & 1 deletion includes/language/portuguese.php
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
Expand Down
1 change: 0 additions & 1 deletion includes/language/portuguese_br.php
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
Expand Down
1 change: 0 additions & 1 deletion includes/language/romanian.php
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
Expand Down
1 change: 0 additions & 1 deletion includes/language/russian.php
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
Expand Down
1 change: 0 additions & 1 deletion includes/language/spanish.php
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permite mostrar información adicional en la lista de elementos (nombre de usuario, correo electrónico y URL). Esto podría ser útil para tener una vista rápida del contenido del elemento.',
'items_page_split_view_mode' => 'Mostrar los detalles del elemento en modo de vista dividida de página',
'replace_tenant_id' => 'Adapte la URL pero mantenga {tenant-id} tal cual. Se reemplazará en vivo por el ID del inquilino.',
'user_exists_but_not_oauth2' => 'El usuario debe autenticarse utilizando Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'El usuario no tiene permitido autenticarse en la aplicación Teampass',
'user_is_not_auth_with_oauth2' => 'El usuario no debe autenticarse con Entra/Azure AD',
'highlight_favorites' => 'Resaltar favoritos',
Expand Down
1 change: 0 additions & 1 deletion includes/language/swedish.php
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
Expand Down
1 change: 0 additions & 1 deletion includes/language/turkish.php
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
Expand Down
1 change: 0 additions & 1 deletion includes/language/ukrainian.php
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Дозволяє відображати додаткову інформацію у списку елементів (ім'я користувача, електронна пошта та URL). Це може бути корисно для швидкого перегляду вмісту елемента.',
'items_page_split_view_mode' => 'Показати деталі елемента у режимі розділеного перегляду сторінки',
'replace_tenant_id' => 'Адаптувати URL, але залишити {tenant-id} як є. Він буде замінений в реальному часі на ID орендаря.',
'user_exists_but_not_oauth2' => 'Користувач повинен автентифікуватися за допомогою Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'Користувачеві не дозволено автентифікуватися за допомогою додатку Teampass',
'user_is_not_auth_with_oauth2' => 'Користувач не повинен автентифікуватися за допомогою Entra/Azure AD',
'highlight_favorites' => 'Виділити обрані',
Expand Down
1 change: 0 additions & 1 deletion includes/language/vietnamese.php
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
Expand Down
7 changes: 5 additions & 2 deletions sources/identify.php
Original file line number Diff line number Diff line change
Expand Up @@ -2229,6 +2229,9 @@ function identifyDoLDAPChecks(
int $sessionPwdAttempts
): array
{
$session = SessionManager::getSession();
$lang = new Language($session->get('user-language') ?? 'english');

// Prepare LDAP connection if set up
if ((int) $SETTINGS['ldap_mode'] === 1
&& $username !== 'admin'
Expand All @@ -2249,7 +2252,7 @@ function identifyDoLDAPChecks(
'initial_url' => isset($sessionUrl) === true ? $sessionUrl : '',
'pwd_attempts' => (int) $sessionPwdAttempts,
'error' => true,
'message' => "LDAP error: ".$retLDAP['message'],
'message' => $lang->get('error_bad_credentials'),
]
];
}
Expand Down Expand Up @@ -2338,7 +2341,7 @@ function shouldUserAuthWithOauth2(
// Case where user exists in Teampass but not allowed to auth with Oauth2
return [
'error' => true,
'message' => 'user_exists_but_not_oauth2',
'message' => 'error_bad_credentials',
'oauth2Connection' => false,
'userPasswordVerified' => false,
];
Expand Down

0 comments on commit 5302a46

Please sign in to comment.