Beta

Create a tenant

A new tenant starts with its own users, OAuth settings, audit history and logs. You are its first Tenant Admin.

The authentication request

OpenID Connect calls the collage app's first message an authentication request. Underneath, it is an OAuth authorization 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=S256

Most 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 code, so the ID token will arrive later in the direct token 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 PKCE 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 nonce 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 party 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.read

The response would then carry an ID token for the sign-in and an access token that the photo API 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:

Further parameters a relying party can send
ParameterWhat it asks forCovered in
promptWhether the provider should show its sign-in, consent, or account selection pages, or show nothing at all.Prompt and account selection
max_ageFresh authentication if the person's last sign-in at the provider was more than this many seconds ago.Session age and reauthentication
login_hintA suggestion of which account to sign in, such as an email address.Login hints
id_token_hintAn ID token issued earlier, identifying the person the relying party expects.Login hints
acr_valuesPreferred authentication contexts, such as a level of assurance the provider and relying party have agreed on.Authentication context and methods
claimsSpecific pieces of information about the person, and where to return them.Scopes and the claims parameter
request, request_uriThe whole request packaged as a signed object, or a reference to one.JWT-Secured Authorization Requests, in Advanced OAuth
ui_locales, displayPreferred 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.

A request asks for scope=profile email but leaves out openid. What should the collage app expect? 1 of 2

Choose one answer.

The collage app sends max_age=300. Can it assume Ava authenticated within the last five minutes? 2 of 2

Choose one answer.

Try it in the Lab

We value your privacy

We use cookies and similar technologies to enhance your browsing experience, and analytics to understand our traffic. By clicking "Allow all", you consent to optional analytics. Cookie Policy

Learn identity