Skip to content

Login page does not display any authentication methods when standard login is enabled (DSpace-CRIS 2024.02.03) #130

@wishbon

Description

@wishbon

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

  1. Install DSpace-CRIS backend 8.2 and DSpace-CRIS Angular 2024.02.03.
  2. Ensure only PasswordAuthentication is enabled: plugin.sequence.org.dspace.authenticate.AuthenticationMethod = org.dspace.authenticate.PasswordAuthentication
  3. Navigate to /login.
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions