The authentication request
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. calls the collage app's first message an authentication request. Underneath, it is 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. 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. request with a few additions, sent through Ava's browser to the same authorization endpoint. Reading it closely shows how little has to change to turn a request for access into a request for sign-in.
Reading the request
Here is the request from Following a complete sign-in again; all domains, identifiers and values in it are fictional:
https://auth.photos.example/authorize
?response_type=code
&client_id=photo-collage
&redirect_uri=https%3A%2F%2Fcollage.example%2Fsignin%2Fcallback
&scope=openid%20profile%20email
&state=demo-signin-3
&nonce=demo-nonce-3
&code_challenge=VJLVyms6-H5HoRQD_d-b-XThm8LNqfrMav0hDI23zpU
&code_challenge_method=S256Most of these parameters do what they did when the printer connected Ava's photo account in the OAuth lessons. response_type=code asks for an authorization codeA short-lived, single-use value that the authorization server sends back to a client through the browser. The client swaps it for tokens in a direct request to the authorization server; APIs never accept it., so the 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. will arrive later in the direct 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. response rather than in Ava's address bar. client_id names the collage app's registration. redirect_uri is the sign-in return address, which must exactly match a registered value. state and the PKCEProof Key for Code Exchange, pronounced pixie: the client creates a secret for each authorization attempt, sends only a hash of it at the start, and proves it holds the secret when redeeming the code, so a stolen authorization code is useless to anyone else. challenge protect the exchange as before. The challenge belongs to a new verifier, created for this attempt only.
Two things are new. The scope begins with openid, and the request carries a nonce. The nonceA random value used for one attempt only. In OpenID Connect, the client sends one in its sign-in request and checks that the same value comes back inside the ID token, showing the token answers this attempt. gets its own lesson next. The scope is what makes this an OpenID Connect request at all.
The openid scope
The openid scope value tells the photo service that the collage app is acting as a relying partyAn application that accepts and relies on a sign-in from another service, the name used in OpenID Connect and for passkeys. SAML calls the same role a service provider. and expects an ID token. Without it, the request is not an OpenID Connect request, and the specification leaves what happens next unspecified. A provider will usually treat it as an ordinary OAuth request: it might still authenticate Ava and issue a code, but the collage app can't count on an ID token in the response, and whatever it did with the result would not be an OpenID Connect sign-in.
The other two values, profile and email, ask for information about Ava rather than for sign-in itself: her name, picture and other basic profile details, and her email address and whether the photo service has verified it. They carry that meaning only alongside openid. Scopes and the claims parameter explains what each one requests and where the information arrives.
A request can combine sign-in with access. To sign Ava in and read her photos in one step, the collage app could ask for:
scope=openid%20profile%20email%20photos.readThe response would then carry an ID token for the sign-in and an access tokenA token that a client presents to an API to use access it has been granted, usually limited in what it allows and how long it lasts. It authorizes API calls; it does not tell the client who signed in. that the photo 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. would accept for reading photos. It is often better not to combine them. Someone signing in to look around may not want to grant photo access yet, and a sign-in page that asks for more than sign-in can lose people at the first step. The collage app can sign Ava in with openid profile email and ask for photos.read later, when she starts choosing photos for a poster.
Other request parameters
OpenID Connect defines further parameters that let the relying party shape the sign-in. The collage app's request uses none of them, but you will meet them in provider documentation and in later lessons:
| Parameter | What it asks for | Covered in |
|---|---|---|
prompt | Whether the provider should show its sign-in, consent, or account selection pages, or show nothing at all. | Prompt and account selection |
max_age | Fresh authentication if the person's last sign-in at the provider was more than this many seconds ago. | Session age and reauthentication |
login_hint | A suggestion of which account to sign in, such as an email address. | Login hints |
id_token_hint | An ID token issued earlier, identifying the person the relying party expects. | Login hints |
acr_values | Preferred authentication contexts, such as a level of assurance the provider and relying party have agreed on. | Authentication context and methods |
claims | Specific pieces of information about the person, and where to return them. | Scopes and the claims parameter |
request, request_uri | The whole request packaged as a signed object, or a reference to one. | JWT-Secured Authorization Requests, in Advanced OAuth |
ui_locales, display | Preferred languages for the provider's pages, and the kind of window they appear in. | Below |
The last two only affect the provider's pages. ui_locales=fr-CA asks the photo service to show its pages in Canadian French if it can, and display=popup tells it the collage app opened a popup window rather than a full page. The provider may ignore either one.
Being ignored is not limited to the interface. Every parameter in the authentication request is a request, not a result. If the collage app sends max_age=300 because it wants a sign-in from the last five minutes, the provider is expected to honor it, but the collage app still checks the auth_time in the ID token it receives. If it asks for a particular authentication context, it checks the context reported back. The authorization endpoint receives the request, and the relying party verifies what was actually done.
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
- Reshape the authentication request one parameter at a timeRemove openid, add a photo scope, send max_age and parameters the provider may ignore, and read how your tenant answers each version of the request.