-
Notifications
You must be signed in to change notification settings - Fork 34
Description
Descripción
In DSpace-CRIS 2024.02.03 (Angular release), the login page displays no authentication methods when only the Password authentication is enabled.
The REST /server/api/authn endpoint works correctly and returns the available method, but the Angular UI shows a completely blank login page (no form, no password fields, nothing).
This affects a clean installation with default configuration.
Steps to reproduce
- Install DSpace-CRIS backend 8.2 and DSpace-CRIS Angular 2024.02.03.
- Ensure only PasswordAuthentication is enabled: plugin.sequence.org.dspace.authenticate.AuthenticationMethod = org.dspace.authenticate.PasswordAuthentication
- Navigate to /login.
- The page loads but no login form is rendered.
Root cause
The issue is caused by incorrect logic in: src/app/shared/log-in/log-in.component.ts, function: filterAndSortAuthMethods(...)
Specifically:
if (!isStandardLoginDisabled) {
return authM.authMethodType !== AuthMethodType.Password;
}
When isStandardLoginDisabled = false (normal installation),
Password authentication is excluded, resulting in an empty list.
Proposed fix
filterAndSortAuthMethods(
authMethods: AuthMethod[],
isBackdoor: boolean,
isStandardLoginDisabled = false,
): AuthMethod[] {
return authMethods
.filter((authMethod: AuthMethod) => {
const methodComparison = (authM: AuthMethod) => {
if (isBackdoor) {
return authM.authMethodType === AuthMethodType.Password;
}
if (isStandardLoginDisabled) {
return authM.authMethodType !== AuthMethodType.Password;
}
return true;
};
return (
methodComparison(authMethod) &&
authMethod.authMethodType !== this.excludedAuthMethod &&
rendersAuthMethodType(authMethod.authMethodType) !== undefined
);
})
.sort(
(method1: AuthMethod, method2: AuthMethod) =>
method1.position - method2.position,
);
}
Impact
- Affects ALL fresh installations using only password login.
- Breaks standard login completely.
- No visual errors; UI simply appears empty.
- Critical for production deployments.