Skip to content

Fix ORCID redirect URI double slash#5884

Open
hernanhlagos wants to merge 1 commit into
DSpace:mainfrom
hernanhlagos:fix/5720-orcid-redirect-uri-double-slash
Open

Fix ORCID redirect URI double slash#5884
hernanhlagos wants to merge 1 commit into
DSpace:mainfrom
hernanhlagos:fix/5720-orcid-redirect-uri-double-slash

Conversation

@hernanhlagos

Copy link
Copy Markdown

References

Description

This PR fixes the ORCID authorization URL generation to avoid adding an extra slash before the entity route in the redirect_uri parameter.

Instructions for Reviewers

This PR keeps the fix intentionally small and limited to the ORCID authorization URL generation.

List of changes in this PR:

  • Updates OrcidAuthService#getOrcidAuthorizeUrl() to pass the raw Angular router path to URLCombiner, instead of encoding the route before combining it with the application origin.
  • Updates the existing unit test to verify that the generated redirect_uri does not contain an encoded leading slash before the /entities/... route.

How to test or review this PR:

  1. Configure ORCID authentication locally or use an environment where ORCID is enabled.
  2. Log in and open the ORCID settings page for a Person entity, for example:
    /entities/person/{uuid}/orcid
  3. Click Connect to ORCID ID.
  4. Verify that the generated ORCID authorization URL contains a redirect_uri with a single slash after the domain before /entities/....

Expected result:

redirect_uri=https://demo.dspace.org/entities/person/{uuid}/orcid

Instead of:

redirect_uri=https://demo.dspace.org/%2Fentities/person/{uuid}/orcid

The updated spec can be run with:

npm test

Checklist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong redirect_uri for ORCID authentication

2 participants