Sign in with NobleID
Let researchers sign in to your journal, repository, conference system or app with their NobleID. With their permission, your app also gets their profile, ORCID iD, affiliations and registered works.
What you get
A standard OpenID Connect provider. Any OIDC library works; each piece of data is a separate scope the person can see and untick on the consent screen.
Sign-in
A stable account identifier (sub) and the person’s NobleID, with no password for you to store.
Profile
Name, username, photo, website and research interests.
Verification flags
Whether the person passed NobleID’s identity check, and whether NobleID staff have marked them a verified researcher.
ORCID iD
The iD on their NobleID profile, flagged verified only when it was connected through ORCID’s own sign-in.
Affiliations
Organization, role and start year as entered by the person.
Works
The works they registered on NobleID, each with its ARK, DOI where there is one, and version.
Everything is read-only. No scope lets an app change a NobleID account or register works on someone’s behalf. (Partner minting, works:write, is planned for a partner program and is not available.)
Get started
- Register an app in Dashboard → OAuth apps. Choose confidential if you have a server, public for a browser-only or native app. Add your exact redirect URI (http is allowed on localhost while you test). You need two-step login on your NobleID to register or edit an app.
- Add the button. It links to your server, which sends the person to the authorize endpoint with PKCE,
stateandnonce. A browser-only app can let the SDK do this. - Handle the callback. Check
stateandiss, exchange the code, verify the ID token and key the account onsub.
Codes and access tokens are short-lived. Ask for offline_access only if you need to call NobleID when the person is not present, and store the new refresh token each time you use one. The consent screen pre-ticks only what is already public on the person's profile.
Code
Copy-paste starting points. Each one uses PKCE, state and nonce and checks the issuer. Do not remove those parts. They ask for openid profile, the scopes a new app has; tick more on your app before you ask for them.
App Router, confidential client, two route handlers, jose for ID-token verification. Link your sign-in button to /auth/nobleid/start.
# .env.local (server-only: no NEXT_PUBLIC_ prefix)
NOBLEID_CLIENT_ID=nbcl_your_client_id
NOBLEID_CLIENT_SECRET=nbcs_your_client_secret
# While you test. In production, register and use your https URL.
NOBLEID_REDIRECT_URI=http://localhost:3000/auth/nobleid/callback
# npm install jose// app/auth/nobleid/start/route.ts
import { NextResponse } from "next/server"
import crypto from "node:crypto"
const b64url = (buf: Buffer) => buf.toString("base64url")
export async function GET() {
const state = b64url(crypto.randomBytes(32))
const nonce = b64url(crypto.randomBytes(32))
const verifier = b64url(crypto.randomBytes(32))
const challenge = b64url(crypto.createHash("sha256").update(verifier).digest())
const url = new URL("https://www.nobleid.org/oauth/authorize")
url.search = new URLSearchParams({
response_type: "code",
client_id: process.env.NOBLEID_CLIENT_ID!,
redirect_uri: process.env.NOBLEID_REDIRECT_URI!,
scope: "openid profile",
state,
nonce,
code_challenge: challenge,
code_challenge_method: "S256",
}).toString()
const res = NextResponse.redirect(url)
// Short-lived, httpOnly, scoped to the callback path. SameSite=Lax is sent
// on the top-level redirect back from NobleID.
res.cookies.set("nobleid_oidc", JSON.stringify({ state, nonce, verifier }), {
httpOnly: true,
secure: process.env.NODE_ENV === "production", // http://localhost while you test
sameSite: "lax",
path: "/auth/nobleid",
maxAge: 600,
})
return res
}// app/auth/nobleid/callback/route.ts
import { NextRequest, NextResponse } from "next/server"
import { createRemoteJWKSet, jwtVerify } from "jose"
const ISSUER = "https://id.nobleid.org"
const JWKS = createRemoteJWKSet(new URL(`${ISSUER}/.well-known/jwks.json`))
function fail(msg: string) {
const res = new NextResponse(`Sign-in failed: ${msg}`, { status: 400 })
res.cookies.delete({ name: "nobleid_oidc", path: "/auth/nobleid" })
return res
}
export async function GET(req: NextRequest) {
const raw = req.cookies.get("nobleid_oidc")?.value
if (!raw) return fail("session expired, try again")
const { state, nonce, verifier } = JSON.parse(raw)
// Check state, then iss, before believing anything else in the URL,
// an error included: a forged callback can carry any error it likes.
const q = req.nextUrl.searchParams
if (q.get("state") !== state) return fail("state mismatch")
if (q.get("iss") !== ISSUER) return fail("issuer mismatch") // RFC 9207
if (q.get("error")) return fail(q.get("error_description") ?? q.get("error")!)
// Token exchange: form-encoded, client_secret_basic.
const id = encodeURIComponent(process.env.NOBLEID_CLIENT_ID!)
const secret = encodeURIComponent(process.env.NOBLEID_CLIENT_SECRET!)
const tokenRes = await fetch(`${ISSUER}/oauth/token`, {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
Authorization: `Basic ${Buffer.from(`${id}:${secret}`).toString("base64")}`,
},
body: new URLSearchParams({
grant_type: "authorization_code",
code: q.get("code") ?? "",
redirect_uri: process.env.NOBLEID_REDIRECT_URI!,
code_verifier: verifier,
}),
cache: "no-store",
})
if (!tokenRes.ok) return fail("token exchange failed")
const tokens = await tokenRes.json()
// Verify the ID token: ES256 signature against NobleID's JWKS, iss, aud, exp.
const { payload } = await jwtVerify(tokens.id_token, JWKS, {
issuer: ISSUER,
audience: process.env.NOBLEID_CLIENT_ID!,
algorithms: ["ES256"],
})
if (payload.nonce !== nonce) return fail("nonce mismatch")
// Optional: claims that are only in userinfo (affiliations, research_interests…)
const userinfo = await fetch(`${ISSUER}/oauth/userinfo`, {
headers: { Authorization: `Bearer ${tokens.access_token}` },
cache: "no-store",
}).then((r) => r.json())
if (userinfo.sub !== payload.sub) return fail("userinfo subject mismatch")
// Key the account on payload.sub (stable). Never link accounts by email
// unless email_verified is true.
// const user = await upsertUser({ nobleidSub: payload.sub, nobleid: payload.nobleid, name: userinfo.name })
// await createYourOwnSession(user)
const res = NextResponse.redirect(new URL("/", req.url))
res.cookies.delete({ name: "nobleid_oidc", path: "/auth/nobleid" })
return res
}Platform guides
Step-by-step settings for research platforms that already support OpenID Connect.
- Open Journal Systems (OJS)Works through KeycloakAdd Sign in with NobleID to an OJS journal, through Keycloak today, or directly once PKP releases the updated plugin.
- WordPressConnects directlyAdd Sign in with NobleID to a WordPress site with the OpenID Connect Generic Client plugin.
- DSpaceConnects directlyAdd Sign in with NobleID to a DSpace repository with its built-in OIDC login, ideally through Keycloak.
- DataverseConnects directlyAdd Sign in with NobleID to a Dataverse installation with its built-in OpenID Connect login.
- MoodleConnects directlyAdd Sign in with NobleID to a Moodle site as a custom OAuth 2 service.
- KeycloakConnects directlyAdd NobleID as an identity provider in Keycloak, so every application behind it can offer Sign in with NobleID.
- JupyterHubConnects directlyLet people sign in to a JupyterHub with NobleID using GenericOAuthenticator.
- DiscourseConnects directlyAdd Sign in with NobleID to a Discourse forum with its bundled OpenID Connect support.
Library settings
PKCE with S256 is required for browser and mobile apps and recommended for server apps. ID tokens are signed with ES256. Many libraries expect RS256 and do not check the iss response parameter, so they need a setting changed or a check added.
| Library | Change |
|---|---|
| openid-client v6 (Node) | Client metadata id_token_signed_response_alg: 'ES256'. Call enableNonRepudiationChecks(config) to verify ID token signatures. PKCE with calculatePKCECodeChallenge. Checks iss itself. |
| openid-client v5 / NextAuth v4 | id_token_signed_response_alg: 'ES256' (the default is RS256). NextAuth v4: idToken: true, checks: ['pkce', 'state', 'nonce']. |
| Auth.js v5 | client: { id_token_signed_response_alg: 'ES256', token_endpoint_auth_method: 'client_secret_basic' }, checks: ['pkce', 'state', 'nonce']. It checks iss but does not verify the ID token signature and does not call userinfo: do both yourself. Its own session sub is not NobleID's sub. |
| Python Authlib | client_kwargs={'code_challenge_method': 'S256'}, or it sends no PKCE. Use client_secret_post. Check iss yourself. |
| Go: go-oidc v3 + x/oauth2 | SupportedSigningAlgs: []string{oidc.ES256}. Set Endpoint.AuthStyle explicitly. Check iss and nonce yourself. |
| Rust: openidconnect 4 | set_allowed_algs(vec![CoreJwsSigningAlgorithm::EcdsaP256Sha256]) on the ID token verifier. Use a custom AdditionalClaims type, or NobleID claims are dropped. Check iss yourself. |
| PHP league/oauth2-client | 'pkceMethod' => 'S256' and 'scopeSeparator' => ' '. Verify the ID token with firebase/php-jwt (ES256) and check iss, aud and nonce yourself. |
| PHP jumbojett/openid-connect-php | Cannot verify ES256 ID tokens (1.0.2). Not usable with NobleID. |
| Spring Security | OidcIdTokenDecoderFactory.setJwsAlgorithmResolver(r -> SignatureAlgorithm.ES256). PKCE for confidential clients with OAuth2AuthorizationRequestCustomizers.withPkce(). Add a filter that checks iss. |
| ASP.NET Core OpenIdConnect | ResponseMode = Query (the default is form_post), UsePkce = true, TokenValidationParameters.ValidAlgorithms = ["ES256"], MapInboundClaims = false. Check iss yourself. |
| Ruby omniauth_openid_connect 0.8 | client_signing_alg: :ES256, pkce: true, send_nonce: true, client_auth_method: :basic, send_scope_to_token_endpoint: false. Check iss and the userinfo sub yourself. |
| Keycloak, WordPress and other platforms | See the platform guides below. |
Scopes & claims
openid is required. Ask only for what you use. People see every scope and can untick the optional ones, so read the granted scope in the token response rather than assuming.
| Scope | Claims |
|---|---|
openidrequiredYour NobleID and a stable account identifier |
|
profileYour name, username, photo, website, research interests and verification badges |
|
emailYour email address |
|
orcidYour ORCID iD, only if you connected it through ORCID's own sign-in |
|
affiliationsYour main institution with its ROR iD, and each institution, role and start year on your profile |
|
worksThe list of works you have registered, with their ARK identifiers, and how many works NobleID has confirmed you as an author of |
|
rolesYour reviewer/editor roles, availability and expertise (subjects, languages, work types, typical turnaround). Never your contribution or other private settings. |
|
offline_accessStay connected when you are not using the app | No claims. Returns a refresh token. |
Works items (GET https://id.nobleid.org/oauth/works, Bearer token with scope works): nobleid, ark, url, title, type, doi, publication_date, publication_year, version, registered_at.
A claim with no value is left out, never sent as null. To fill your own app's profile from these claims, see Fill your app's profile from NobleID.
Endpoints
| Issuer | https://id.nobleid.org |
| Discovery | https://id.nobleid.org/.well-known/openid-configuration |
| Authorization | https://www.nobleid.org/oauth/authorize |
| Token | https://id.nobleid.org/oauth/token |
| Userinfo | https://id.nobleid.org/oauth/userinfo |
| JWKS | https://id.nobleid.org/.well-known/jwks.json |
| Revocation | https://id.nobleid.org/oauth/revoke |
| End session (sign-out) | https://www.nobleid.org/oauth/logout |
| Introspection | https://id.nobleid.org/oauth/introspect |
| Pushed authorization (PAR) | https://id.nobleid.org/oauth/par |
| Works list (scope works) | https://id.nobleid.org/oauth/works?limit=50&offset=0 |
- The authorization endpoint is the consent page on
www.nobleid.org; every other endpoint is under the issuer,id.nobleid.org. Fetch the discovery document rather than hard-coding URLs. - Only
response_type=code. PKCE must beS256: browser and mobile apps must use it; server apps should. No implicit or hybrid flow, noplainPKCE. - The token endpoint accepts
application/x-www-form-urlencodedonly. ID tokens areES256JWTs. - The authorization response includes
iss(RFC 9207). Check it equals the issuer.
Security requirements for your integration
- Use PKCE with S256, with a fresh random verifier of at least 32 bytes. Browser and mobile apps must; server apps should.
- Send a random
stateand check it on return; send anonceand check it in the ID token. - Check
issin the authorization response, andiss,aud(your client ID) andexpin the ID token. - Verify the ID token’s ES256 signature against the JWKS on your server. Cache the key set and refetch when you see an unknown
kid. - Register exact redirect URIs. They are compared character for character; https only, except http on localhost / 127.0.0.1 / [::1], where the port may vary. A public native app may also use a reverse-DNS scheme such as
org.example.app:/callback. - Keep the client secret on your server. Browser and mobile apps must be public clients.
- Key accounts on
sub, never on email. Never link an existing account by email unlessemail_verifiedistrue. - Refresh tokens are single-use: store the new one each time.
- On sign-out, revoke the refresh token at
https://id.nobleid.org/oauth/revoke. - To end the NobleID session too, send the person to
https://www.nobleid.org/oauth/logoutwithid_token_hint,post_logout_redirect_uriandstate(OpenID Connect RP-Initiated Logout 1.0, GET or form POST). NobleID asks a signed-in person to confirm, then returns them to that URL with yourstate. Add the URL to the app's sign-out return URLs in the dashboard first. It must match exactly.
Security
- Tokens are short-lived and signed. Verify ID tokens against the published keys (JWKS).
- People can disconnect an app at any time in Settings → Connected apps.
- Partner apps can only be registered and managed from accounts with two-step login.
What a NobleID sign-in tells you: the person controls a NobleID account that signs in with email and password, Google or Apple, and, if they have turned it on, also entered a code from an authenticator app (two-step login). Two-step login is optional, so read amr (below) to see how this sign-in was done. identity_verified tells you separately whether the account holder passed an identity check.
How the person signed in (amr)
ID tokens from the authorization-code exchange carry amr (RFC 8176): the methods the person used to sign in to NobleID for this session, alongside auth_time.
| Value | Meaning |
|---|---|
pwd | Email and password. |
google | Sign in with Google (Google verified the account; NobleID did not see a password). |
apple | Sign in with Apple. |
privy | Legacy sign-in (Privy), kept for older accounts. |
otp | A code from the person’s authenticator app (RFC 6238 TOTP), or one of their single-use backup codes. |
mfa | Two methods were used: one of the above plus otp. |
Examples: ["pwd"], ["pwd","otp","mfa"], ["google"], ["google","otp","mfa"].
- To require two-step login, check that
amrcontainsotpand send the person back if it does not; they can turn it on in their NobleID security settings. - If
amris absent, treat the sign-in as password or provider only. acris not used.max_ageandprompt=loginare supported.prompt=logindoes not ask again if the person signed in within the last 2 minutes. To force a fresh sign-in, sendmax_age=0and checkauth_time.- Two-step login is a time-based code from an authenticator app, with single-use backup codes. NobleID does not offer passkeys, WebAuthn security keys or SMS codes.
Branding
- Use the official button: pick a label, theme, shape and size on the button page, or let the SDK draw it. Don’t redraw, recolor or stretch the logo.
- Wording: “Sign in with NobleID” or “Continue with NobleID”.
- Pick a theme that stands out from the page: black or green on white, white or green on dark. Use an outline button only where its text reads clearly against your background.
- Minimum height 40px. Keep clear space around the button of at least half its height (20px at 40px).
- Keep a visible focus outline on the link or button.
- Place it with equal prominence next to your other sign-in options.
- Show a person’s NobleID as the full link, e.g.
https://www.nobleid.org/{nobleid}(thenobleid_uriclaim).
FAQ
- What is the difference between sub and nobleid?
- sub is an opaque, stable account identifier. Use it as your database key. nobleid is the person’s public NobleID code, for display and linking.
- Can my app register works or edit a profile?
- No. All scopes are read-only. Partner minting (works:write) is planned for a partner program and is not available today.
- Is there single sign-out?
- Your app can end the person’s NobleID session: send them to https://www.nobleid.org/oauth/logout. NobleID asks a signed-in person to confirm, then returns them to a registered sign-out return URL with your state. There is no front-channel or back-channel logout, so other apps the person signed in to stay signed in. Also sign the person out of your own app and revoke their refresh token.
- How does my app get the verified badge on the consent screen?
- Email info@nobleid.org with your client ID to request verification. Until then people see a “not verified” notice.
Test client
Run a real sign-in against NobleID with your own client ID, and see exactly what your app would receive.
- In OAuth apps, register a public client (or edit one) and add this redirect URI exactly:
https://www.nobleid.org/developers/sign-in/callback- Paste its client ID below, pick scopes, and run the flow. You will see the real consent screen.
- On return, this page exchanges the code (a public client sends no secret), checks the ID token’s signature against NobleID’s published keys, and shows its claims and the userinfo response.
Confidential clients cannot be tested here: their code exchange needs the client secret, which must never be typed into a web page. Use your own server, or register a second, public client for testing.