diff --git a/src/app/core/auth/auth.interceptor.ts b/src/app/core/auth/auth.interceptor.ts index 84d4c532101..d011d27059a 100644 --- a/src/app/core/auth/auth.interceptor.ts +++ b/src/app/core/auth/auth.interceptor.ts @@ -129,12 +129,24 @@ export class AuthInterceptor implements HttpInterceptor { */ private sortAuthMethods(authMethodModels: AuthMethod[]): AuthMethod[] { const sortedAuthMethodModels: AuthMethod[] = []; + let passwordAuthFound = false; + let ldapAuthFound = false; + authMethodModels.forEach((method) => { if (method.authMethodType === AuthMethodType.Password) { sortedAuthMethodModels.push(method); + passwordAuthFound = true; + } + if (method.authMethodType === AuthMethodType.Ldap) { + ldapAuthFound = true; } }); + // Using password authentication method to provide UI for LDAP authentication even if password auth is not present in server + if (ldapAuthFound && !(passwordAuthFound)) { + sortedAuthMethodModels.push(new AuthMethod(AuthMethodType.Password,0)); + } + authMethodModels.forEach((method) => { if (method.authMethodType !== AuthMethodType.Password) { sortedAuthMethodModels.push(method);