Skip to content

Commit d4536ff

Browse files
minurmingithub-actions[bot]
authored andcommitted
Ensure that password authentication dialog is shown even if only ldap auth method is present
(cherry picked from commit 83d86d7)
1 parent 6b73c75 commit d4536ff

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/app/core/auth/auth.interceptor.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,24 @@ export class AuthInterceptor implements HttpInterceptor {
116116
*/
117117
private sortAuthMethods(authMethodModels: AuthMethod[]): AuthMethod[] {
118118
const sortedAuthMethodModels: AuthMethod[] = [];
119+
let passwordAuthFound = false;
120+
let ldapAuthFound = false;
121+
119122
authMethodModels.forEach((method) => {
120123
if (method.authMethodType === AuthMethodType.Password) {
121124
sortedAuthMethodModels.push(method);
125+
passwordAuthFound = true;
126+
}
127+
if (method.authMethodType === AuthMethodType.Ldap) {
128+
ldapAuthFound = true;
122129
}
123130
});
124131

132+
// Using password authentication method to provide UI for LDAP authentication even if password auth is not present in server
133+
if (ldapAuthFound && !(passwordAuthFound)) {
134+
sortedAuthMethodModels.push(new AuthMethod(AuthMethodType.Password,0));
135+
}
136+
125137
authMethodModels.forEach((method) => {
126138
if (method.authMethodType !== AuthMethodType.Password) {
127139
sortedAuthMethodModels.push(method);

0 commit comments

Comments
 (0)