Repository navigation
Add a sign-up API for the modern UI, with optional ORCID iD - #12858
Open
ChengShi-1 wants to merge 9 commits into
Open
ChengShi-1 wants to merge 9 commits into
ChengShi-1 wants to merge 9 commits into
Conversation
New users can create their own builtin account without an API token or the :BuiltinUsersKey, for example from the SPA sign-up form. The new SignUpBuiltinUserCommand applies the same validation rules and messages as the JSF Sign Up page, creates the builtin and authenticated user, and sends the standard welcome email with the confirm-email link. The account is usable right away; email verification before creation is planned as a follow-up. The endpoint is off unless the dataverse.feature.api-builtin-user-signup feature flag is set, honors :AllowSignUp, and is rate-limited per client IP address via dataverse.api.signup.rate-limit-per-hour (default 10). affiliationRor is rejected until the ROR column from #12620 exists. The dev compose file enables the flag and turns off the rate limit so SPA development and repeated integration test runs work out of the box. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GET /api/users/signup/orcid/authorize returns the ORCID authorization URL for an allowed redirect URI (dataverse.api.signup.orcid-redirect-uris). POST /api/users/signup/orcid exchanges the code, returns the ORCID profile for pre-filling and an encrypted orcidToken, which POST /api/users/signup accepts to save the ORCID iD on the new account. An ORCID iD already linked to another account is rejected. The user JSON now includes authenticatedOrcid. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Parse ORCID API v3.0 employment summaries, prefer the current employment with the latest start date, and return the affiliation's ROR ID and a suggested username from POST /api/users/signup/orcid. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
Cover POST /api/users/signup and the ORCID sign-up endpoints with Mockito tests, and restore the thread's interrupt flag when the ORCID token exchange is interrupted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 27, 2026
Merged
This comment has been minimized.
This comment has been minimized.
…ault dataverse.api.signup.orcid-redirect-uris is now only needed when the SPA's sign-up page is somewhere else. Also tidy the sign-up docs and formatting in Users.java.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…dbox An installation can reuse its existing production ORCID client by registering the SPA's sign-up URL as a redirect URI. Development installations using the sandbox register 127.0.0.1 instead of localhost.
This comment has been minimized.
This comment has been minimized.
ChengShi-1
marked this pull request as ready for review
November 3, 2026 16:06
ChengShi-1
added a commit
to IQSS/dataverse-client-javascript
that referenced
this pull request
Nov 3, 2026
The sign-up endpoints aren't in the unstable image yet. Switch back to docker.io/unstable once #12858 is merged.
|
|
📦 Pushed preview images as 🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name. |
ChengShi-1
added a commit
to IQSS/dataverse-frontend
that referenced
this pull request
Nov 3, 2026
Sets up the backend from IQSS/dataverse#12858 with Maven and this branch's dev environment, with a checklist for testers. To be deleted before merging.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What this PR does / why we need it:
Adds the API behind the sign-up form in the modern UI (SPA), so new users can create a builtin account without the JSF "Sign Up" page and without Keycloak. They can optionally connect their ORCID iD while signing up.
POST /api/users/signupcreates a builtin user. It uses the same validation as the JSF "Sign Up" page, respects:AllowSignUp, and is rate-limited per client IP address.GET /api/users/signup/orcid/authorizeandPOST /api/users/signup/orcidconnect an ORCID iD before the account exists:"enabled": false.affiliationRor) and a suggested username.orcidToken, which the sign-up request uses to save the ORCID iD to the new account.GET /api/users/:menow includesauthenticatedOrcid.dataverse.api.signup.orcid-redirect-uris), so every installation needs to set its own SPA sign-up URL.Everything is behind the
dataverse.feature.api-builtin-user-signupfeature flag and off by default.Which issue(s) this PR closes:
Special notes for your reviewer:
I wrote most of the code with the help of AI, then manually reviewed it and ran some tests. Please bear with me as I'm not very experienced with Java, and feel free to flag anything that doesn't look right during your review.
If the changes are too complicated to explain in comments, you're also welcome to push a commit or create a separate branch with your suggested fixes. Thank you for your help!
Suggestions on how to test this:
Set
DATAVERSE_FEATURE_API_BUILTIN_USER_SIGNUP=1. For local testing, also setDATAVERSE_API_SIGNUP_RATE_LIMIT_PER_HOUR=0, which turns off the rate limit.Sign up without ORCID:
Check that the user can log in, and that invalid fields, a duplicate username or email,
:AllowSignUp=falseand the rate limit return errors.Sign up with ORCID (optional; needs your own ORCID sandbox credentials)
Setup
@mailinator.comemail to use developer tools) Under Developer Tools, register an app with the redirect URIhttp://127.0.0.1:8000/modern/sign-up. ORCID doesn't acceptlocalhostredirect URIs, so use127.0.0.1here and everywhere below."enabled": falseis fine).DATAVERSE_API_SIGNUP_ORCID_REDIRECT_URIS=http://127.0.0.1:8000/modern/sign-up. It must match the redirect URI exactly: same host, port and path, no trailing slash.Option A: from the SPA. Open
http://127.0.0.1:8000/modern/sign-upwithsignUpWithOrcidEnabled: truein the SPA'sconfig.js, then click "Create or Connect your ORCID iD" and finish at ORCID. The form should show your ORCID iD and fill in the empty fields.Option B: with curl. Stop the SPA dev server first. Otherwise the SPA uses ORCID's one-time code before you can.
Sign in at ORCID and click "Authorize access". The browser then goes to
http://127.0.0.1:8000/modern/sign-up?code=...&state=...; the page itself may show 502. Copycodeandstatefrom the address bar:What to check
authorize.codea second time returns 400; ORCID codes work only once.orcidTokenand a new username and email is refused with "This ORCID iD is already linked to another account."orcidTokenis refused.stateexpires after 15 minutes andorcidTokenafter 30.Without an ORCID provider configured,
authorizereturns 404 "ORCID is not configured on this installation." Signing up without ORCID (step 2) works the same either way.Unit tests:
mvn test -Dtest='OrcidOAuth2APTest,OrcidSignUpTokensTest,SignUpBuiltinUserCommandTest'.Does this PR introduce a user interface change? If mockups are available, please link/include them here:
No change to the JSF UI. API only
Is there a release notes update needed for this change?:
Yes, added in
doc/release-notes/spa-builtin-user-signup.md.Additional documentation:
native-api.rst.dataverse.feature.api-builtin-user-signup,dataverse.api.signup.rate-limit-per-hour,dataverse.api.signup.orcid-redirect-uris.🤖 Generated with Claude Code