Registering a relying party
A client registration already says where a provider may send codes and which scopes a client may ask for. Once the client signs people in, the same registration also decides how its ID tokens are signed, which subject identifier it receives, how recent a sign-in should be, and where people return after signing out.
What OIDC adds to a registration
The collage app has read Ava's photos for a while: it is registered at the photo service as an OAuthA framework that lets a person give an application limited access to their resources at another service, using tokens instead of sharing their password. OAuth is about access; OpenID Connect adds sign-in. client, as Client IDs and registration described, with the client ID photo-collage, its grant types and the way it authenticates. When it added Continue with your photo account, its developer went back to the photo service's developer console and added the sign-in return address, https://collage.example/signin/callback. Further down, the console offered a group of settings that only matter once a client signs people in.
OpenID ConnectAn identity layer on top of OAuth 2.0 that lets an application sign people in with an account at another service. It adds the ID token, standard claims, and discovery to the OAuth exchange. Dynamic Client Registration gives these settings standard names. A provider's console may label them differently or leave some out, but the names are the ones a client uses when it registers through an APIAn application programming interface: a defined way for software to interact with a service. A web API offers endpoints where other programs send HTTP requests. instead of a console, which Registering a client dynamically, in Advanced OAuth, covers. With the OAuth settings shortened, the collage app's registration now reads:
{
"client_id": "photo-collage",
"redirect_uris": [
"https://collage.example/oauth/callback",
"https://collage.example/signin/callback"
],
"token_endpoint_auth_method": "client_secret_basic",
"scope": "openid profile email photos.read",
"application_type": "web",
"id_token_signed_response_alg": "RS256",
"subject_type": "public",
"require_auth_time": true,
"post_logout_redirect_uris": ["https://collage.example/signed-out"]
}Two lines put familiar settings to new use. The sign-in address sits in redirect_uris beside the address the collage app already used for photo access, and it is matched exactly, character for character, like the other one. A sign-in request that names https://collage.example/signin/callback/, with a final slash, is refused: the photo service shows its own error page and never redirects, because sending a code to an address the client never registered could hand it to someone else. And openid joins the scopes the collage app may request, with profile and email. A provider that limits scopes by registration would otherwise refuse openid or drop it, and the collage app would receive no ID tokenIn OpenID Connect, a signed JWT from the provider, addressed to one client, saying which account authenticated, when, and in answer to which request. It reports a sign-in and is not used to call APIs..
What the collage app asks for
- client_id
- photo-collage
- scope
- openid profile email
- redirect_uri
- https://collage.example/signin/callback/
What the photo service has on file
- client_id
- photo-collage
- scope
- openid profile email photos.read
- redirect_uris
- https://collage.example/signin/callback
Matched exactly, character for character: refused.
The photo service shows its own error page and never redirects.
application_type says what kind of application the client is: web, the default, or native for an installed app. Providers use it to apply return-address rules that suit each kind. Under the OpenID Connect registration rules, a native client may register only custom-scheme addresses and loopback addresses such as http://127.0.0.1, and a provider may add rules of its own for installed apps. The collage app is a website, so it is a web client. If its makers later shipped a phone app, the app would get a registration of its own, and if it returned to a claimed HTTPSHTTP protected by TLS, so traffic is encrypted and checked for changes while it travels. It protects the connection, but does not prove that the site at the other end is honest. address, as Redirect URIs and client metadata described, that registration would use web under these rules, even though the app is installed on a phone.
The remaining settings fall into two groups. Some shape the tokens and claims the collage app receives. Others set defaults for how Ava is asked to sign in and tell the provider where the collage app can be reached when a sessionThe ongoing connection between later requests and an earlier sign-in, so you are not asked for your password on every click. It is often tracked with a cookie holding an unpredictable session identifier. ends.
Settings for tokens and claims
id_token_signed_response_alg names the one algorithm the provider will use to sign ID tokens for this client. It defaults to RS256, which every OpenID ProviderA service that authenticates users and tells other applications about the sign-in, so those applications never handle the users' passwords. In OpenID Connect it is called an OpenID Provider. supports, and the collage app states it anyway so that nobody has to remember the default. This setting and the collage app's own allowlist of algorithms describe the same decision from two sides. If someone changed the registration to ES256 without changing the collage app, every sign-in would fail with the configuration mismatch described in When validation fails, and the fix would be to make the two agree again, not to accept both.
The specification lets a client register none, meaning unsigned ID tokens, only if it never receives an ID tokenA piece of data issued by a trusted service that a client presents as a credential, for example to call an API or to report a sign-in. Some tokens carry readable claims; others are random strings that only the issuer can interpret. from the authorizationDeciding whether a requested action is permitted, such as whether a signed-in account may delete a particular photo. Authentication says which account is asking; authorization decides what it can do. endpoint, which is the case Receiving the ID token discussed. The collage app validates every signatureA value made with a private key that lets anyone holding the matching public key check that a message came from the key's holder and has not been changed. It proves origin and integrity; it does not hide the message., so it never registers none.
Two related settings ask for more protection. id_token_encrypted_response_alg and id_token_encrypted_response_enc ask the provider to sign each ID token and then encryptTransforming data so that only someone holding the right key can read it. It protects confidentiality and, unlike hashing, is designed to be reversed by the key holder. it, as a JWEThe JOSE format for encrypted content, defined in RFC 7516, which only holders of the right key can read. A JWT is sent as a JWE when its claims must stay confidential, not just protected from change., to a public key the client publishes, so that only the client can read it. userinfo_signed_response_alg asks for UserInfo responses as signed JWTs instead of the plain JSON a client receives without it. The UserInfo endpoint works with plain JSON, and Signed and encrypted messages, in Advanced OIDC, covers both kinds of protection.
subject_type chooses which kind of sub the collage app receives, from the types the provider lists in subject_types_supported. With public, the photo service gives the collage app the same identifier, user-2048, that it gives every other application Ava signs in to. With pairwise, each client receives a different identifier for her, so applications cannot compare notes about her by matching it. A client whose return addresses span several hosts can add a sector_identifier_uri, the address of a list of those return addresses, so that all of them receive the same pairwise identifiers. Public and pairwise subject identifiers explains both.
This is the setting to decide before launch. The collage app links each person's account to the issuer and sub it receives, so switching from public to pairwise later would give every existing user, Ava included, a different sub, and none of them would match their account.
Settings for sign-in and logout
Three settings concern the authentication behind each sign-in. Two of them are standing versions of things a single authorization request can ask for. A request may carry a max_age parameter, the most seconds that may have passed since the person last authenticated at the provider, and an acr_values parameter, which names one or more authentication context classes: labels a provider defines for how strongly someone authenticated, such as a password alone or a password with a second factor. The ID token's acr claim reports which class the sign-in actually met.
require_auth_time, whentrue, makesauth_timemandatory in every ID token for this client. The collage app sets it, so every ID token it receives says when Ava last authenticated, like the one in ID tokens and access tokens.default_max_ageis a number of seconds. If Ava's last authentication at the provider is older than that, the provider must ask her to authenticate again. Amax_ageparameter in a particular request overrides it.default_acr_valueslists, in order of preference, the authentication context classes the client would like the provider to satisfy. Anacr_valuesparameter in a particular request overrides it.
The collage app sets only the first. Each of these is a standing request, applied to every sign-in for this client, and none of them excuses the collage app from checking the result. A provider that ignored default_max_age would still produce a validly signed token. The collage app compares auth_time and acr with what it needs, as Session age and reauthentication and Authentication context and methods describe. Defaults suit rules that apply to every sign-in. A rule for one action, such as signing in again before deleting a collage, belongs in the request for that action.
The remaining settings are addresses at the collage app that the provider or another service may use later. Each is registered in advance, like a return address, so the provider only ever sends people or messages where the client said it would:
| Setting | How it is used | Covered in |
|---|---|---|
post_logout_redirect_uris | The provider sends Ava's browser back to one of these, matched exactly, after the collage app has asked it to sign her out. | RP-initiated logout |
frontchannel_logout_uri | The provider loads this page in Ava's browser, in a hidden frame, to tell the collage app that her session at the provider has ended. | Front-channel logout |
backchannel_logout_uri | The provider sends a signed logout token, a JWT naming the session that ended, here directly, server to server, when her session at the provider ends. | Back-channel logout |
initiate_login_uri | Another service, such as a dashboard of applications, sends Ava's browser here to ask the collage app to start a sign-in with the provider. | Third-party initiated login |
The collage app registers https://collage.example/signed-out as the place to return after signing out, and leaves the two logout notification addresses empty for now. Once it registers them, it will also make use of a session identifier, sid, a value the photo service puts in its ID tokens to name Ava's session at the provider, so that later logout messages can say which session they end. The collage app has no use for initiate_login_uri either, since its users start every sign-in at the collage app.
Every one of these choices belongs to one registration at one provider. When the collage app adds a second provider, it makes them all again, separately.
Check your understanding
Try these questions before moving on. If an answer isn't right, use the feedback and try again.
Try it in the Lab
- Map OpenID Connect registration settings onto lab-collageWrite lab-collage's registration with the standard names, find where your tenant keeps each setting, try default_max_age and exact return addresses, register a sign-out return address, and break sign-in.