Sign in with NobleID on DSpace
Add Sign in with NobleID to a DSpace repository with its built-in OIDC login, ideally through Keycloak.
- Written for
- DSpace 8.x to 10.x. The OIDC plugin has not changed since DSpace 7.2, so 7.2 to 7.6 should behave the same.
- Tested
- Written from the platform's documentation and source code. Not yet run against NobleID.
Register on NobleID
- In Dashboard → OAuth apps, register a confidential app. You need two-step login on your NobleID to do this.
- Add this redirect URI, with your own host:Register exactly the value your
https://repo.example.org/server/api/authn/oidcdspace.server.urlproduces, followed by/api/authn/oidc. - Tick these scopes: OpenID (always on), Profile
profile, Emailemail. The platform asks for these, and sign-in stops if it asks for a scope the app does not have. - Copy the client ID and the client secret. The secret is shown once.
The app works at once. Until NobleID verifies it, people see a “not verified” notice on the consent screen.
How DSpace's OIDC login behaves
Read this before you turn it on:
- It sends the client secret in the request body (
client_secret_post), then reads the person from the userinfo endpoint. It does not read the ID token, so ES256 needs no setting. - It sends no
state,nonceor PKCE, and nothing can be configured to add them. - It finds the DSpace account (EPerson) by email, not by
sub, and does not reademail_verified. A NobleID account with an unconfirmed email would sign in as the EPerson with that address. That includes administrators. - If the person unticks
emailon NobleID's consent screen, DSpace refuses the sign-in. - Signing out ends the DSpace session only.
Recommended: put Keycloak in front (Keycloak guide). Keycloak runs the sign-in with state, nonce and PKCE. It keeps unconfirmed emails out only if you turn on Trust Email on the NobleID identity provider and Realm settings → Login → Verify email in the realm DSpace uses. Then point DSpace at Keycloak, not NobleID: set the three endpoints below to https://sso.example.org/realms/<realm>/protocol/openid-connect/auth, …/token and …/userinfo. DSpace's defaults use the old /auth/realms/ path, which Keycloak 17 and later do not use by default.
Connect DSpace to NobleID directly only where no existing EPerson matters: a test instance, or a repository with no local accounts (and no administrators) whose email someone else could use.
Configure
Add to [dspace]/config/local.cfg, then restart the backend. The Angular UI shows the OIDC login option once the REST API reports it.
# Keep password login and add OIDC. Repeating the key appends a method.
plugin.sequence.org.dspace.authenticate.AuthenticationMethod = org.dspace.authenticate.PasswordAuthentication
plugin.sequence.org.dspace.authenticate.AuthenticationMethod = org.dspace.authenticate.OidcAuthentication
# Full endpoint URLs. Leave auth-server-url and auth-server-realm unset.
authentication-oidc.authorize-endpoint = https://www.nobleid.org/oauth/authorize
authentication-oidc.token-endpoint = https://id.nobleid.org/oauth/token
authentication-oidc.user-info-endpoint = https://id.nobleid.org/oauth/userinfo
authentication-oidc.client-id = nbcl_your_client_id
# Better: leave this out of local.cfg and set the environment variable
# authentication__D__oidc__P__client__D__secret=nbcs_your_client_secret
authentication-oidc.client-secret = nbcs_your_client_secret
# Must match the redirect URI registered with NobleID exactly.
authentication-oidc.redirect-url = ${dspace.server.url}/api/authn/oidc
# Comma-separated in DSpace config; sent space-separated.
authentication-oidc.scopes = openid,email,profile
# true: the first NobleID sign-in creates an EPerson. false: existing EPersons only.
authentication-oidc.can-self-register = false
authentication-oidc.user-info.email = email
authentication-oidc.user-info.first-name = given_name
authentication-oidc.user-info.last-name = family_name- The class name is case-sensitive:
OidcAuthentication, notOIDCAuthentication. - Setting
plugin.sequence…inlocal.cfgreplaces the list inauthentication.cfg, so list every method you want to keep. - DSpace has no discovery URL, issuer, JWKS or logout setting. It uses only the three endpoints above.
orcid,worksandaffiliationsadd nothing in DSpace. It maps only email, first name and last name.
Fill the profile from NobleID
| NobleID claim | DSpace field | Scope |
|---|---|---|
email | EPerson email (authentication-oidc.user-info.email) | email |
given_name | First name (authentication-oidc.user-info.first-name) | profile |
family_name | Last name (authentication-oidc.user-info.last-name) | profile |
DSpace reads only these three. Ticking ORCID iD or Affiliations on your app adds nothing here.
Every claim, and how to fill a profile without overwriting what people edit: Fill your app's profile from NobleID.
Before you go live
- Sign in once with your own NobleID. People need a first and last name on their NobleID profile to sign in; NobleID asks for it if it is missing.
- Key accounts on
sub. Link to an existing account by email only whenemail_verifiedis true. - Remove any localhost redirect URIs from the app.
- Keep the client secret out of version control.
NobleID values
| Issuer | https://id.nobleid.org |
| Discovery URL | https://id.nobleid.org/.well-known/openid-configuration |
| Authorization endpoint | https://www.nobleid.org/oauth/authorize |
| Token endpoint | https://id.nobleid.org/oauth/token |
| Userinfo endpoint | https://id.nobleid.org/oauth/userinfo |
| JWKS URL | https://id.nobleid.org/.well-known/jwks.json |
| Revocation endpoint | https://id.nobleid.org/oauth/revoke |
| End-session endpoint | https://www.nobleid.org/oauth/logout |
| ID token signing | ES256 |
Sources
Something here does not match what you see? Email info@nobleid.org.