OAuth server: an existing grant auto-approves and returns no client details, leaving no room for an account-confirmation step #48385
Unanswered
scarletkc
asked this question in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Summary
GoTrue's OAuth server does not honour the standard OIDC
promptparameter(OIDC Core 1.0 §3.1.2.1). As a consequence, when the signed-in user already has
a grant covering the requested scopes,
GET /oauth/authorizations/{authorization_id}does two things at once:
{ "redirect_url": "...?code=..." }, andclient, nouser, noscope.Because both happen inside a single unparameterised GET, a custom authorization
UI configured for GoTrue's OAuth server cannot present the "you are signed in as
X, continue?" step that Google, Microsoft and Okta show on a repeat
authorization. There is no point at which the code has not yet been issued and
the client is still known.
Current behaviour
First authorization (no grant yet) — full details:
{ "authorization_id": "...", "redirect_uri": "...", "client": { "id": "...", "name": "..." }, "user": { "id": "...", "email": "..." }, "scope": "openid profile" }Repeat authorization (grant exists, same scopes) — a destination only:
{ "redirect_url": "https://.../callback?code=..." }The second shape carries no client identifier, so the UI cannot look up which
application is asking, cannot name it on screen, and cannot offer "use a
different account" against it. The code in that URL is already valid, so any
confirmation rendered afterwards is cosmetic — the authorization has happened.
This same GET also binds the authorization to the currently signed-in user.
Signing out and returning with the original
authorization_idtherefore failson a user mismatch, which is why an account switch cannot simply resume the
request it started from.
Expected behaviour
A. Honour
prompton the authorize request.prompt=consent, return the full authorization details and defer codeissuance until an explicit approve or deny action.
prompt=select_account, keep the authorization unbound until the userhas selected an account, or provide a supported way to preserve and resume the
original authorization request across an account switch.
prompt=none, complete silently only when an authenticated session andsufficient prior consent already exist; otherwise return the corresponding
OIDC interaction error (
login_required,consent_required, oraccount_selection_required).B. Include client details alongside
redirect_url.Less complete — the code is still issued up front, so a "cancel" button would be
untruthful — but it would at least let the screen name the application and the
account.
(A) is preferable: it makes the confirmation step meaningful rather than
decorative, and
promptis already the standard mechanism relying parties useto request exactly this.
Reproduction
GOTRUE_OAUTH_SERVER_ENABLED=true) and register aconfidential client with
openid profile.GET /oauth/authorizations/{authorization_id}returns theredirect_urlshape. No request parameter changes this.
Why it matters
On a shared device, or for anyone holding more than one account, a repeat
sign-in currently completes with no indication of which account was used and no
way to switch. The relying party cannot compensate: it never sees the
authorization server's session, and the only workaround available to the user is
to visit the account site manually and sign out before returning.
Environment
GOTRUE_OAUTH_SERVER_ENABLED=true, hosted Supabaseopenid profileAll reactions