Prompt and account selection
An authenticationChecking evidence that someone, or some application, controls an account, such as a password or a passkey. It establishes which account is being used, not what that account may do. request can tell the provider how much to show the person: nothing at all, a fresh sign-in, a consent screen again, or a choice between accounts. The prompt parameter carries that wish, and each value has its own answers for the application to handle. All domains, identifiers and tokens in these examples are fictional.
Asking without interrupting
Offline access and refresh behavior ended with a limit. A refreshed 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. still carries the time of the original sign-in, and a successful refresh says nothing about whether anyone is at a browser. When an application needs to learn something about the person now, it has to send the browser back to the provider's 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. That raises a question the application hasn't had to answer before: how much should the provider show the person while they are there?
The prompt parameter is how the application answers. It appeared as prompt=consent, which made the provider ask again before granting offline access. It has other values, and each tells the provider something different about the interaction the application wants.
Ava Archer signed in to the collage app with her photo account at 09:00 UTC on 1 October. By the next morning her collage 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. has expired, and she opens collage.example again. The collage app no longer knows who she is. It could show its sign-in page and wait for her to choose Continue with your photo account, but she probably still has a session at the photo service in this browser. If she does, a click that sends her there and straight back is wasted effort.
With prompt=none, the collage app can find out without showing her anything. It sends its usual authentication request with one extra parameter:
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-4
&nonce=demo-nonce-4
&code_challenge=gwVlmAVBIZ7cJBaJAwIkTniP3Mp-iIrrGgr3DOJZNnk
&code_challenge_method=S256
&prompt=noneApart from the last line, this is the request the collage app always sends, with a new state, nonce and 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. pair for this attempt. prompt=none tells the photo service that it must not display any sign-in or consent page. It either answers from what it already knows or returns an error.
This morning the photo service still has Ava's session, and she approved the collage app's request when she first signed in. It returns a code without showing a page, and her browser is back at the collage app almost before the address bar changes. The collage app exchanges the code and validates the 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. as it would after any sign-in, including 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. demo-nonce-4. One claim deserves a closer look:
{
"iss": "https://auth.photos.example",
"sub": "user-2048",
"aud": "photo-collage",
"iat": 1790928000,
"exp": 1790928300,
"auth_time": 1790845185,
"nonce": "demo-nonce-4"
}The token was issued at 08:00 on 2 October, but auth_time is still 08:59:45 on 1 October, the last time Ava actually used a credential at the photo service. Nothing new was authenticated this morning. The photo service only confirmed that this browser still holds her session, and like a refresh, that doesn't show she is the one using it. The collage app creates a new session of its own and records the older auth_time, not the time of the silent check, because Session age and reauthentication depends on the true value.
On a morning when Ava had signed out of the photo service, the same request would come back with an error instead:
https://collage.example/signin/callback
?error=login_required
&state=demo-signin-4
&iss=https%3A%2F%2Fauth.photos.exampleThe collage app checks the state and issuerThe party that creates and signs a token, assertion, or certificate, named in a token's iss claim. A recipient must check that the issuer is exactly the one it expected and trusts. just as it would for a success, then shows its sign-in page as if it had never asked. For a silent check, an error is an ordinary answer, not a failure to investigate. Each error names the page the photo service would have needed to show:
| Error | What the photo service would have needed to show |
|---|---|
login_required | A sign-in page, because it has no session it can use for this request. |
consent_required | A consent screen, because Ava hasn't approved what the collage app is asking for. |
account_selection_required | An account chooser, because several of her accounts are signed in and it can't pick one. |
interaction_required | Some other page, such as updated terms to accept or a step its own policy requires. |
Answered from what it knows
- Provider session
- Ava
- Earlier approval
- Yes
- Page it would need
- None
- Answer
- A code
Signed in with the earlier auth_time
No session to use
- Provider session
- None
- Earlier approval
- Yes
- Page it would need
- A sign-in page
- Answer
- login_required
Show its own sign-in page
Session without consent
- Provider session
- Ava
- Earlier approval
- No
- Page it would need
- A consent screen
- Answer
- consent_required
Show its own sign-in page
Ava and her club account
- Provider session
- Two accounts
- Earlier approval
- Yes
- Page it would need
- An account chooser
- Answer
- account_selection_required
Show its own sign-in page
One silent check when a visit starts is enough. Answering an error with another prompt=none request can bounce the browser back and forth without end.
What the collage app must not do is try again on its own. An app that answers login_required with another prompt=none request, or that runs a silent check on every page load, can bounce the browser back and forth without end. One silent check when a visit starts is enough. After that, the next request to the photo service should be an interactive one that Ava started by choosing to sign in.
Applications that run in the browser once made these checks in a hidden frame, loading the authorization request in an invisible iframe so the page never navigated away. That pattern no longer works reliably. Inside a frame on collage.example, the photo service is a third party, and browsers increasingly withhold third-party cookies, as What browsers add described: some block them or keep a separate cookieA small value that a website asks the browser to store and send back with later matching requests. Cookies commonly carry a session identifier, so the site can recognize an ongoing sign-in without your password. jar for each site by default, and the others let people turn them off. When the photo service can't see its own session cookie, it answers login_required even though Ava is signed in. The check works as a top-level redirect like the one above, where the photo service's cookies are first-party.
Asking again
Sometimes the collage app wants the opposite: an interaction the photo service would otherwise skip.
prompt=login asks the photo service to authenticate Ava again even though she has a session. If it can't, it returns an error, typically login_required. The collage app would use it when it needs evidence that the person at the keyboard can still sign in as Ava, not only that this browser holds her session. Session age and reauthentication follows that case, and shows why the collage app then checks auth_time itself instead of trusting that its request was honored.
prompt=consent asks the photo service to show its consent screen even if Ava has approved this request before. If it can't obtain consent, it returns consent_required. Offline access is the case the specification names: a request for offline_access carries prompt=consent because an earlier approval isn't always enough for access that continues while Ava is away. An application might also use it when it wants her to look again at what she is sharing. The consent screen still belongs to the photo service. The collage app can ask for it to appear, but it can't change what it says.
The parameter takes a space-separated list, so prompt=login consent asks for a fresh sign-in and a consent screen. The exception is none, which must stand alone. A request with prompt=none login asks for no pages and a sign-in page at once, and the photo service returns an error instead of guessing which the collage app meant.
Choosing an account
Ava also keeps a second photo account, which she uses for a neighborhood photography club. Some providers let a person stay signed in to several accounts in the same browser and switch between them. When the collage app sends an ordinary request, such a provider picks one, often the one used last. If that happens to be the club account, the collage app receives a perfectly valid sign-in for an account Ava didn't mean to use, and it may create a new, empty collage account to go with it.
The collage app's sign-in page can offer a way out, a link labeled Use a different photo account, which sends prompt=select_account. The photo service then shows its account chooser, even if it could have picked an account itself. If it can't get a choice from Ava, it returns account_selection_required, the same error a silent check receives when the photo service would have needed to ask.
The chooser is the photo service's page, not the collage app's. The collage app never learns which other accounts Ava has. It receives only the sign-in for the one she picked, validated and looked up by its issuer and subject like any other.
One more value comes from a separate, newer specification, Initiating User Registration via 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.. prompt=create, sent on its own, asks the provider to open its account creation page instead of its sign-in page, so a collage customer without a photo account can go straight to signing up. What happens on that page is the provider's decision, and someone who already has an account may simply sign in with it, so the collage app can't assume an account was created. It handles the response like any other sign-in. A provider that supports the value lists create in the prompt_values_supported field of its discovery documentA JSON document that an OpenID Provider publishes at a well-known address under its issuer, listing its endpoints, where to find its signing keys, and its supported features so clients can configure themselves from one value., and the collage app offers its sign-up link only then, because a provider that doesn't recognize a prompt value may reject the request or quietly ignore the value.
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
- Drive the prompt values and read each answerProduce login_required and consent_required on purpose, see a hint for another account refused, use the account chooser, force a fresh sign-in and consent, see why none stands alone, and try prompt=create.