Apps: which flow
| Kind of app | Register as | Flow |
|---|---|---|
| Server-side web app | --confidential, https redirect URIs | Authorization code with PKCE; client secret at the token endpoint (Basic or form) |
| Single-page app | public (no --confidential) | Authorization code with PKCE (S256); refresh tokens with offline_access |
| Native or desktop app | public, a claimed https link (https://app.example/cb, a universal link or app link), a loopback redirect (http://127.0.0.1:PORT/…) or a private-use scheme (com.example.app:/cb) | Authorization code with PKCE, in the system browser (RFC 8252). At a loopback or private-use redirect, the person confirms each sign-in (below) |
| TV, console, command-line tool | public | Device authorization (RFC 8628) |
| Service with no user | --machine | Client credentials (APIs and services) |
Rules every app meets
- Redirect URIs match exactly. A trailing slash, an extra query, another port or another case won't match. An unregistered redirect URI is never redirected to: the person sees an error page at Nod.
- PKCE is required for public clients, and only S256 is accepted (
plainis refused). Acode_verifiersent for a code that had no challenge is refused too. - **
login_hint** (OIDC Core §3.1.2.1): a username or address the app already knows fills in the sign-in page's username field. Only a hint: whoever signs in is who the code is for. - Codes are single-use and live 60 seconds. A code used twice revokes the tokens the first use gave.
- **Check
iss** in authorization responses (RFC 9207). Nod always sends it, and it tells you which realm (issuer) answered. - Refresh tokens rotate. Each use returns a new one, and reusing an old one revokes the whole grant. So store the newest, and don't refresh from two places at once.
Asking for less, or more
- Scopes:
openidis required.profilereleases names, picture, locale and so on, where known.emailreleasesemailandemail_verified.offline_accessasks for a refresh token. Unknown scopes are ignored. - **The
claimsparameter** (OpenID Connect Core §5.5) names individual claims for the ID token or userinfo:claims={"userinfo":{"name":null}}. - **
prompt=loginasks the person to sign in again.prompt=none** never shows a page: you geterror=login_requiredif they aren't signed in (consent_requiredfrom a third-party app they haven't agreed to, or from any app answered at a loopback or private-use redirect: below). **prompt=consentasks a third-party app's person to agree again.max_age=N** asks them to sign in again if their last sign-in is older than N seconds.
Someone else's app (third-party)
An app the realm's owner doesn't run, such as a partner's integration, registered with --third-party (or "third_party": true). Before it gets anything, the person sees what it asks for and chooses Allow or Deny (Auth0's third-party applications). The realm's own apps don't ask for permissions (but see native apps).
- Asked once per app and scopes. Agreeing covers those scopes for that app. Asking for one more scope asks again, and asking for fewer doesn't.
prompt=consentalways asks. - Deny goes back to the app with
error=access_denied. **prompt=none** without agreement getserror=consent_required. - Taken back when the person's grants are revoked (
POST /users/{id}/revoke), or when the app is deleted: an app registered again under the same id is a new app and asks again. - The page shows the app's name and each scope (the standard ones in words, as the realm's custom text
consent.scope_*; an API's scopes as they are), always as text. The security log recordsconsent.givenwith the scopes. - A machine client can't be third-party: there's nobody to ask.
nod client register acme partner-crm --redirect https://crm.partner.example/cb --confidential --third-party
Native apps: each sign-in confirmed
On a phone or a computer, any app can register the same private-use scheme as yours (com.example.app:/cb), or listen on the same loopback port (http://127.0.0.1:7777/cb). Such an app can start a sign-in under your app's client id, with its own PKCE challenge, and catch the code (RFC 8252 §8.6, RFC 6819 §4.2.3). Nod can't tell it from your app, and your being the realm's administrator doesn't help: your app isn't the one that gets the code. So a public app answered at a loopback or private-use redirect has every sign-in confirmed by the person:
- Every time, whoever's app it is. The realm's own app gets one tap: "Continue to Acme CLI as alice?", with Continue and Cancel. A third-party app gets its permissions page (above), even for scopes the person agreed to before. Nothing confirmed is reused for the next sign-in, and it's asked right after signing in too.
- **
prompt=none** getserror=consent_required. Cancel goes back to the app witherror=access_denied. - **Native apps: use
127.0.0.1or[::1], notlocalhost** (RFC 8252 §8.3):localhostis a name, which the machine's resolver or hosts file may point somewhere else, and an app may not get the address it listens on. Nod still acceptshttp://localhostredirect URIs, because web apps in development use them and browsers treatlocalhostas secure; it counts as loopback either way, so a native app there has each sign-in confirmed. - Loopback is any
127.x.x.x,[::1]orlocalhostaddress, http or https; private-use is any scheme but https. - Not asked: a claimed https redirect (a universal link on iOS, an App Link on Android, or any other https address), where the domain vouches for the app; and a confidential client, which can't redeem a code without its credentials.
To remove the prompt, move the app to a claimed https link. Register https://app.example/cb, prove you own the domain to the operating system (Apple's apple-app-site-association, Android's assetlinks.json), and sign in with that redirect: it goes straight back, as a web app does.
When you accept the risk for one of the realm's own apps, for example a command-line tool on machines you manage, an administrator can turn the prompt off for that app alone. It's off by default, never allowed for a third-party or machine client, and each change is in the security log as client.native_confirmation:
nod client native-confirmation acme acme-cli skip # ask: back to confirming every sign-in
curl -X PATCH https://auth.example.com/acme/api/v1/clients/acme-cli -H "authorization: Bearer $TOKEN" \
-H 'content-type: application/json' -d '{"skip_native_confirmation": true}'
Apps that register themselves (RFC 7591)
Where the realm allows it (nod realm set acme --open-registration on, or "open_registration": true), anyone may register an app: discovery lists registration_endpoint, and POST <issuer>/register with the app's metadata answers 201 with its client_id (and client_secret, unless token_endpoint_auth_method is none). It's off by default.
curl -s https://auth.example.com/acme/register -H 'content-type: application/json' \
-d '{"client_name": "Partner CRM", "redirect_uris": ["https://crm.partner.example/cb"]}'
What a registered app can be is narrow:
- Always third-party: people are asked before it gets anything (above), whatever the request says.
- Signs people in only:
grant_typesauthorization_code(withrefresh_tokenif wanted),response_typescode. Client credentials, the device flow, CIBA, token exchange and API grants are an administrator's to give. - Nothing Nod would fetch from or post to:
jwks_uri,jwks,sector_identifier_uri,request_uris,backchannel_logout_uriandinitiate_login_uriare refused (invalid_client_metadata). - Redirect URIs are checked as for any client (
invalid_redirect_uri): https, loopback http or a reverse-domain scheme, at most 10. - Its name (
client_name, one line, at most 100 characters) is shown only as text. Logo, policy, terms and home-page URLs aren't kept. Other metadata is ignored, as RFC 7591 requires. - Ten registrations per address per hour. Each lands in the security log as
client.registered, and the management API lists it with"registered": true. - Changing or deleting a registered app is an administrator's (the management API); RFC 7592's client configuration endpoint isn't offered.
Pushed authorization requests (RFC 9126)
An app with a back end can send its authorization request to Nod directly instead of through the browser:
curl -u web:$SECRET $ISSUER/par -d response_type=code -d redirect_uri=https://app.example/cb \
-d scope=openid -d state=… -d nonce=… -d code_challenge=… -d code_challenge_method=S256
# 201 {"request_uri": "urn:ietf:params:oauth:request_uri:…", "expires_in": 60}
Then send the browser to $ISSUER/authorize?client_id=web&request_uri=<request_uri>.
- The request is checked when it is pushed, exactly as
/authorizewould check it, and the client authenticates (a public client sends itsclient_id). - **The
request_uriworks until your app gets its answer** (a code or an error), for 60 seconds at most, and only with theclient_idthat pushed it. A reload or a second tab before then shows the same sign-in again (RFC 9126 §7.3); one code comes back, and after it therequest_uriis refused. - **
/authorizeuses only the pushed request.** Anything else on the URL is ignored, so nobody between your back end and Nod can read or change the request's parameters. - Discovery names the endpoint (
pushed_authorization_request_endpoint), and libraries such as openid-client use it with one call (buildAuthorizationUrlWithPAR).scripts/interopchecks that.
Signed requests (JAR, RFC 9101)
An app can sign its authorization request, so nothing between it and Nod can change it. Register the app's public keys (a JWKS), then send the parameters as a signed JWT in request:
nod client keys acme web web-jwks.json # {"keys": [{"kty": "EC", "crv": "P-256", "kid": "k1", …}]}
/authorize?client_id=web&request=eyJhbGciOiJFUzI1NiIsImtpZCI6ImsxIiwidHlwIjoib2F1dGgtYXV0aHotcmVxK2p3dCJ9…
- Only the signed parameters count. Anything else on the URL is ignored.
- The object must be signed by one of the app's registered keys (ES256, EdDSA or RS256;
kidchooses), withissthe app,audthis issuer, anexpin the future and no more than an hour after itsiatornbf.typ, if given, must beoauth-authz-req+jwt. Anything wrong is shown on Nod's page, never sent back to a redirect URI that hasn't been verified yet. - By value only.
request_uriis for pushed requests. Nod never fetches a URL a request names. A request object can be pushed too:requestin the/parbody. - Registered keys are public keys only, one to ten of them.
Tokens bound to a key (DPoP, RFC 9449)
A stolen bearer token works for whoever has it. With DPoP, an app's tokens work only with a private key the app holds and never sends. The app sends a DPoP header (a proof signed by its key) with each token request:
- What it gets is
token_type: "DPoP"and an access token whosecnf.jktis the key's thumbprint. A public app's refresh token (if any) works only with a proof by the same key; a confidential app's is already bound to its credentials, so it may prove a new key (RFC 9449 §5), and the new access token is bound to that one. Its refresh token isn't rotated either (FAPI 2.0 forbids it): the same one comes back. A public app's rotates at each use. A refused refresh doesn't use the token up. - Binding the code too (RFC 9449 §10): send a DPoP proof with the PAR request, or
dpop_jkt(the key's thumbprint) with the authorization request, and only a proof by that key redeems the code. A PAR request whosedpop_jktand proof disagree is refused withinvalid_dpop_proof; so is a code redeemed with another key's proof, which leaves the code unused. - Using the access token means
Authorization: DPoP <token>plus a proof for that request (withath, the token's hash). Nod's userinfo refuses a bound token sent asBearer, a proof by another key, and a proof for another token. Your API should do the same: checkcnf.jkt(introspection returns it) against the proof's key. - Each proof must be
typ: dpop+jwt, signed with ES256, EdDSA or RS256 by the public key in its own header (nevernoneor HMAC). It names this request's method and URL (htm,htu; the query is ignored), is no more than 60 seconds from now (iat), and is used once (jti). - Libraries do this for you: openid-client's
getDPoPHandle, for one, andscripts/interopchecks it end to end.
FAPI 2.0: requiring PAR and DPoP per app
For apps that move money or other things that matter (FAPI 2.0's Security Profile), Nod can hold an app to the two rules its own settings would otherwise leave optional:
nod client register acme bank --confidential --redirect https://bank.example/cb --require-par --require-dpop
# or: PATCH $ISSUER/api/v1/clients/bank {"require_pushed_authorization_requests": true, "dpop_bound_access_tokens": true}
- **
require_pushed_authorization_requests** (RFC 9126 §6): its requests come only through PAR, and any other is refused. That includes the links behind "Continue with…" buttons. For such an app they carry a request Nod pushed itself, never the request in a query anyone could edit, and the way back from an outside provider or an email link goes through a freshly pushed request too. - **
dpop_bound_access_tokens** (RFC 9449 §5.2): every token request needs a DPoP proof (or, for an app that authenticates with its TLS certificate, that binding). Without one it'sinvalid_dpop_proof, and nothing is used up: the code or refresh token still works with a proof. - With
private_key_jwt(or mTLS) client authentication, PKCE S256,issin the response and 60-second codes, which Nod always does, that is FAPI 2.0's Security Profile.
Devices (RFC 8628)
- The device posts
client_idandscopeto<issuer>/device_authorization, and optionallyresource(RFC 8707, one of the realm's APIs: the tokens are then that API's; one the realm doesn't have isinvalid_target). It gets back adevice_code, auser_code(likeBCDF-GHJK), theverification_uriandverification_uri_complete, and aninterval.nod loginuses this for a person's console token (accounts). - It shows the code and the URI (or a QR code of
verification_uri_complete), then polls<issuer>/tokenwithgrant_type=urn:ietf:params:oauth:grant-type:device_code. - Meanwhile the person opens the URI, signs in, and sees which app asks for what. Nothing happens until they press Approve.
- The poll answers
authorization_pendinguntil then. Polling faster thanintervalgivesslow_downand a longer interval. Then come the tokens, once, oraccess_denied, orexpired_tokenafter 10 minutes.
Signing someone in from elsewhere (CIBA)
A bank's branch kiosk or a call-centre agent's tool knows who the customer says they are, and needs them to approve on their own device. With OpenID CIBA (poll mode) the app names the person, Nod emails them a link to approve, and the app polls for tokens:
nod client ciba acme kiosk on # or PATCH /api/v1/clients/kiosk {"ciba": true}
curl -u kiosk:$SECRET https://auth.example.com/acme/bc-authorize \
-d scope=openid -d login_hint=alice@example.com -d binding_message="K7 RIVER"
# {"auth_req_id": "…", "expires_in": 600, "interval": 5}
curl -u kiosk:$SECRET https://auth.example.com/acme/token \
-d grant_type=urn:openid:params:grant-type:ciba -d auth_req_id=…
# authorization_pending, slow_down, then tokens; access_denied if they say no
- Only confidential clients you turn it on for: the app chooses whom to notify.
- Only the person named can decide: the link opens Nod's approval page, signed in (within the last ten minutes, to approve), and shows nothing of the request to anyone else. A nod for an org's action is the exception: the org's policy may let other members decide.
- Show a binding message (up to 64 characters) on your screen and send it in the request. The email and the page show it, and the person approves only if they match. This is the number-matching defence against approving someone else's request.
- Three requests per person per minute, from all apps together. Flooding someone with prompts until they approve one (MFA fatigue) stops there, and every request is in the security log (
ciba.requested). login_hintis a username, a verified email, orsub:<user id>(for a server that holds only a token naming the person). A person without a verified email can't be asked (unknown_user_id).- Approving one action:
authorization_detailswith oneurn:nod:action, andagent=for a platform or runtime asking for its agent. See Nod.
Logging out
<issuer>/logoutends the browser's session at Nod (OpenID Connect RP-Initiated Logout). Sendid_token_hintwith the ID token you got for this person, so Nod knows your app is asking: it signs them out at once, and with a registeredpost_logout_redirect_uri(andstate) sends the browser back to you. Without a valid hint, Nod asks the person to confirm, so that a link on another site can't sign people out.- To end a user's access everywhere, revoke their tokens (
<issuer>/revoke) or all their grants (the management API'susers/{id}/revoke). - Back-channel logout: register
--backchannel https://app.example/logout-hook(orbackchannel_logout_urithrough the management API). When a browser session that signed in to your app ends at Nod, Nod postslogout_token=<JWT>there:typ: logout+jwt, signed like your ID tokens, withiss,aud(your client id),sub,sid(matching thesidin the ID token) and the back-channel logout event. End your own session for thatsid. The session's grants are revoked at the same time, exceptoffline_accessones.