Skip to content

Bring the API spec up to date with OAuth 2.1 support - #281

Merged
longsleep merged 1 commit into
libregraph:masterfrom
longsleep-io:upstream/5-api-spec
Oct 14, 2026
Merged

longsleep merged 1 commit into
libregraph:masterfrom
longsleep-io:upstream/5-api-spec

Conversation

@longsleep

Copy link
Copy Markdown
Collaborator

Updates docs/libregraph-connect-api-v1.yaml to what master does since #273. Documentation only, no code change.

Some statements were wrong, not just missing:

  • The token response was said to have no scope member. It always carries the granted scopes.
  • code_challenge_methods_supported said no client is required to send a challenge. Dynamically registered clients, static clients with require_pkce, and every client under --require-pkce must.
  • response_type claimed bare code is not advertised. It is; only bare token and code token are accepted without being advertised.
  • The token endpoint was said to accept only client_secret_basic or none. It also accepts client_secret_post.

Added

Authorize

  • The resource parameter (RFC 8707): one value, normalized, must be registered, narrows the requested scopes except openid and offline_access, and is otherwise refused with an invalid_target redirect.
  • Which clients must send a code_challenge, and that this is enforced at the token endpoint.

Token

  • Public clients, resource on both grants, scope narrowing on refresh with invalid_scope, redirect_uri being ignored on refresh, refresh token rotation, and scope in the response.

Registration

  • Public clients without a secret, PKCE for every dynamic client, client_secret_basic as the default, client_secret_expires_at: 0 for a secret which does not expire, and the invalid_redirect_uri and invalid_client_metadata errors.

Schemas

  • AccessTokenClaims: the claims of an access token and how a resource server validates one.
  • ResourceRegistration: the resources section of identifier-registration.yaml.
  • StaticClientRegistration gains require_pkce.

The spec version goes from 1.1.0 to 1.2.0.

The OpenAPI spec lagged behind the OAuth 2.1 work on master since libregraph#273:
resource indicators, public clients, PKCE requirements and refresh
token handling. Some of it was wrong rather than missing. It said the
token response has no scope member, that
code_challenge_methods_supported requires no client to send a
challenge, that bare code is not advertised as a response_type, and
that the token endpoint accepts only client_secret_basic or none. The
spec now describes what the code does, and its version goes from 1.1.0
to 1.2.0. The info section lists RFC 8414, RFC 7636 with S256 only and
RFC 8707.

The authorize endpoint gains the resource parameter: a single value,
normalized, which must be registered, narrows the requested scopes
except openid and offline_access, and is otherwise refused with an
invalid_target redirect. code_challenge states which clients must send
one, dynamic clients, static clients with require_pkce and all clients
under --require-pkce, and that this is enforced at the token endpoint.
The POST form lists the new parameters.

The token endpoint names client_secret_post besides client_secret_basic
and none, and describes public clients. resource is accepted on both
grants and must match, else invalid_target. A refresh may narrow scope,
refused with invalid_scope otherwise, ignores redirect_uri and rotates
the refresh token when offline_access was granted. The token response
carries scope.

The new AccessTokenClaims schema describes iss, sub, aud with a single
value, azp only when the token is bound to a resource, scp as a space
delimited list, exp, iat and jti, and how a resource server validates
such a token. bearerAuth and the access_token of the token response
refer to it.

Registration documents public clients registered without a secret,
PKCE required for every dynamic client, client_secret_basic as the
default, client_secret_expires_at being 0 unless
--dynamic-client-secret-duration is set, and 400 JSON errors with
invalid_redirect_uri or invalid_client_metadata. Static registration
gains require_pkce, token_endpoint_auth_method none and the new
ResourceRegistration schema for the resources array, whose id is
normalized at startup and used as aud, with name, scopes and
implicit_scopes. OIDCError is also used by registration and its enum
gains invalid_target, invalid_redirect_uri and invalid_client_metadata.
@longsleep
longsleep merged commit 2c05b4c into libregraph:master Oct 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant