Skip to content
Workforce IdentityMarkdown

Check quietly whether a user is signed in

Let an app find out, without showing any page, whether the user already has a session with the realm.

APIOpenID Connect Core 1.0

An app can sign a user in automatically when they’re already signed in to the realm, and otherwise show its own Sign in button. It starts a normal sign-in with prompt=none, and the realm never shows a page: the user sees nothing, whatever the answer, and the app decides what to show next.

Before you start:

  1. The app adds prompt=none to its usual sign-in request at https://foobar.cvyuh.com/oauth2/authorize.

  2. It reads the answer at its return address:

    The user…The app receives
    is signed in and has allowed this appa code, as after any sign-in
    isn’t signed inlogin_required
    is signed in, but hasn’t allowed this app what it asksconsent_required
  3. On a code, the app redeems it as usual. On login_required or consent_required, it shows its Sign in button, which starts a sign-in without prompt=none.

Open the app in a browser that is signed in to the realm: it should sign you in with no page shown. In a private window, it should get login_required and show its button.

SymptomCauseFix
Always login_required, even when signed inThe browser doesn’t send the realm’s cookie to the app’s frame or redirect, often a third-party cookie block in an embedded frameUse a top-level redirect, not a hidden frame
consent_required for a user who allowed the appThe app asks for more scopes than they allowed, or for offline_access, which is asked every timeAsk for the scopes they allowed; leave offline_access for the interactive sign-in

Stop sending prompt=none. Nothing changes in the realm.

prompt=What it does
noneNever show a page, as above
loginAlways ask the user to sign in again, even with a session: see Ask users to sign in again
consentAlways show the consent page, even if the user allowed this before