Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

08 Provider

An OAuth 2.1 authorization server with two fixed levels (decision 001).

Both levels

  • Authorization code with PKCE S256 only. A code lives 60 seconds, works once, and reuse revokes what it gave.
  • Redirect URIs match exactly. Loopback addresses (RFC 8252) may differ in port only.
  • A bad request shows an error page and never redirects: anyone can register a client, so a redirect without the user’s choice would make the server an open redirector.
  • iss in every authorization response (RFC 9207). Metadata per RFC 8414.
  • resource (RFC 8707) is required. A token has one audience, and an API MUST check it.
  • Tokens are opaque. ID tokens exist only for openid requests, are signed, and are for the client only.
  • The user is asked for consent by the login origin. No consent is remembered for write scopes of connected apps.

First-party clients

Registered by the application in its configuration. They use pushed requests (RFC 9126) and DPoP. Confidential clients use private_key_jwt. This is the base for login on tenant domains.

Connected apps

Apps by others, for example agents that connect through a protocol with public clients and bearer tokens.

Rule
RegistrationClient ID Metadata Documents first; RFC 7591 where a protocol needs it, rate-limited, removed when unused
Client authenticationprivate_key_jwt if the client offers it, else public with PKCE. No client secrets
TokenBearer, or DPoP if the client offers it. Once a grant used DPoP, it stays with DPoP
Access tokenAt most 1 hour
Refresh tokenOne use. Reuse of an old one revokes the grant
ScopeFrom a list that the application marks as allowed for connected apps
NeverCredentials, sessions, recovery, devices, consent, invites
Protected resource metadataRFC 9728 for each API
The user canList, inspect and revoke grants

A metadata document is fetched over HTTPS from a public address only. The fetcher refuses redirects, private, loopback and link-local addresses after DNS resolution, and more than 64 KiB†, and has a timeout. The consent page shows the client’s host name, because a name in a document proves nothing.

Relation to other profiles

First-party clients follow the direction of FAPI 2.0, plus rules for public clients. ID tokens are signed with ES256. An application whose clients need RS256 adds an RSA key, which OpenID Connect Core requires of a provider. Other parts of OpenID Connect (userinfo, dynamic scopes, front-channel logout) do not exist, so this is not a certified provider.