Skip to content

OIDC authentication fails to redirect to originally requested page (redirects to /home instead) #12133

@z-stoynova

Description

@z-stoynova

Describe the bug

There is an issue with redirection after login when using OIDC authentication. We are using Keycloak with DSpace-CRIS 2024.02.01.

When accessing a restricted page (e.g., “Edit Collection Template” at /itemtemplate), the user is prompted to authenticate. After a successful login, the user is expected to be redirected back to the originally requested page. However, instead of returning to the requested page, the user is always redirected to the /home page. This issue is reproducible in DSpace 8.1 as well (tested with ORCID authentication). The problem does not occur when using:

  • Username/password authentication
  • Shibboleth authentication

To Reproduce

Steps to reproduce the behavior:

  1. Enable OIDC authentifcation (e.g. ORCID)
  2. Navigate to an item details page or to a log-in-protected page
  3. Log in
  4. Observe that the user is redirected to /home

Expected behavior

After successful authentication, the user should remain on—or be redirected back to—the page they originally attempted to access.

Metadata

Metadata

Assignees

Labels

affects: 8.xIssue impacts 8.x releasesaffects: 9.xIssue impacts 9.x releasesauthentication: OIDCrelated to OpenID Connect (OIDC)authentication: ORCIDrelated to authentication via ORCIDbugusabilityA backend issue that may result in usability issues in the UI layer

Type

Projects

Status

🏗 In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions