Hello!
I am testing the new ORCID integration in OMP 3.5.0-5 using the ORCID Public API Sandbox.
Connecting an ORCID iD from the user profile works correctly when the authorization is accepted.
However, if the user selects Deny on the ORCID authorization page, OMP returns an HTTP 500 error instead of handling the cancelled authorization and returning the user to their profile.
The error does not appear to leave the user account in a broken state. The ORCID field remains empty, and the user can start the ORCID connection process again afterwards. Still, I thought it might be useful to report this behaviour so it can be handled more gracefully.
Steps I took leading up to the issue
-
Configure OMP to use the ORCID Public API Sandbox with valid sandbox API credentials.
-
Log in as a user.
-
Open the user profile.
-
Start the Connect ORCID iD process.
-
OMP redirects correctly to sandbox.orcid.org.
-
On the ORCID authorization screen, choose Deny instead of authorizing access.
-
ORCID redirects back to the OMP callback URL.
-
OMP displays an HTTP 500 error.
The browser shows:
This page isn’t working
[DOMAIN] is currently unable to handle this request.
HTTP ERROR 500
Expected behaviour
If the user denies or cancels the ORCID authorization request, OMP should handle the OAuth denial gracefully.
For example, it could return the user to their profile and display a message indicating that ORCID authorization was cancelled or denied.
It should not result in an HTTP 500 response.
Actual behaviour
The ORCID denial callback results in HTTP 500.
The ORCID iD is not added to the user profile, which is correct, and the user can subsequently restart the ORCID connection process successfully.
Application
OMP 3.5.0-5
ORCID configuration
-
API type: Public API
-
Environment: ORCID Sandbox
-
Successful authorization: works
-
Denied authorization: HTTP 500
Additional information
This appears to affect specifically the denied/cancelled OAuth path. The successful OAuth authorization flow works correctly with the same configuration and credentials.
As I am not very familiar with this part of the ORCID/API integration, I used AI assistance to check whether I might have configured something incorrectly. It suggested that the configuration is probably not the cause, and that the denied authorization path may simply not be handled in the same way as the successful one. Please feel free to correct me, if i I have made a wrong assumption, but I thought this might also be useful information when investigating the issue:
It ckecked the current stable-3_5_0 code. Other ORCID OAuth paths, such as author verification, explicitly handle the access_denied response, but the user-profile flow goes through AuthorizeUserData, where it could not identify equivalent handling for a denied authorization. It appears to proceed with the token/user-data processing even when no authorization code has been returned.
This may of course be an incorrect interpretation, I am not very familiar with this part of the codebase, but I thought the observation might still be useful when looking into the issue.
Thank you in advance for looking into this. I would be happy to provide more details or help with further testing if needed.
Kind regards, Tiffany