API Reference
oauth2
8 endpoints across 6 paths
- /oauth2/.well-known
- /oauth2/authorize
- /oauth2/introspect
- /oauth2/revoke
- /oauth2/token
- /oauth2/userinfo
/oauth2/.well-known
/oauth2/.well-known/jwks.jsonJwks
JSON Web Key Set endpoint.
Returns the public keys used to verify ID tokens and other JWTs.
Responses
any
Example request
curl -X GET "https://api.davi.social/oauth2/.well-known/jwks.json" \
-H "Authorization: Bearer <token>"/oauth2/.well-known/openid-configurationOpenid Configuration
OpenID Connect Discovery document.
Returns the OAuth2/OIDC server configuration.
Every URL here is built from the configured issuer, never from the path the
request arrived on. The router is reachable at more than one prefix — the
canonical /oauth2 mount plus two deprecated aliases — and OIDC requires
the discovery issuer to equal the iss claim of an id_token exactly. A
path-derived issuer makes that impossible: it says something different
depending on which prefix a client happened to use, and at most one of
those can match what the tokens actually carry.
Responses
| Field | Type | Description |
|---|---|---|
| issuer* | string | |
| authorization_endpoint* | string | |
| token_endpoint* | string | |
| userinfo_endpoint | string | null | |
| revocation_endpoint | string | null | |
| introspection_endpoint | string | null | |
| jwks_uri | string | null | |
| response_types_supported* | string[] | |
| grant_types_supported* | string[] | |
| code_challenge_methods_supported* | string[] | |
| token_endpoint_auth_methods_supported* | string[] | |
| scopes_supported* | string[] | |
| claims_supported | string[] | null | |
| subject_types_supported | string[] | null | |
| id_token_signing_alg_values_supported | string[] | null |
Example request
curl -X GET "https://api.davi.social/oauth2/.well-known/openid-configuration" \
-H "Authorization: Bearer <token>"/oauth2/introspectIntrospect
Token Introspection Endpoint (RFC 7662).
Allows clients (typically resource servers) to validate tokens.
Header parameters
| authorization | string | null |
Responses
| Field | Type | Description |
|---|---|---|
| active* | boolean | Whether the token is active |
| scope | string | null | |
| client_id | string | null | |
| username | string | null | |
| token_type | string | null | |
| exp | integer | null | Expiration timestamp |
| iat | integer | null | Issued at timestamp |
| nbf | integer | null | Not before timestamp |
| sub | string | null | Subject (user identifier) |
| aud | string | null | Audience |
| iss | string | null | Issuer |
| jti | string | null | JWT ID |
| Field | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| detail | ValidationError[] | |||||||||||||
array items · ValidationError
| ||||||||||||||
Example request
curl -X POST "https://api.davi.social/oauth2/introspect" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{ /* request body */ }'/oauth2/revokeRevoke
Token Revocation Endpoint (RFC 7009).
Revokes an access or refresh token.
Header parameters
| authorization | string | null |
Responses
any
| Field | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| detail | ValidationError[] | |||||||||||||
array items · ValidationError
| ||||||||||||||
Example request
curl -X POST "https://api.davi.social/oauth2/revoke" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{ /* request body */ }'/oauth2/tokenToken
OAuth2 Token Endpoint.
Supports:
- authorization_code: Exchange code for tokens
- refresh_token: Refresh access token
Header parameters
| authorization | string | null |
Responses
| Field | Type | Description |
|---|---|---|
| access_token* | string | |
| token_type | string | default: "Bearer" |
| expires_in* | integer | Token lifetime in seconds |
| refresh_token | string | null | |
| scope | string | null | Space-separated granted scopes |
| id_token | string | null | OIDC ID token (when openid scope granted) |
| issued_token_type | string | null | RFC 8693: Type of token issued (for token exchange responses) |
| Field | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| detail | ValidationError[] | |||||||||||||
array items · ValidationError
| ||||||||||||||
Example request
curl -X POST "https://api.davi.social/oauth2/token" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{ /* request body */ }'/oauth2/userinfoOauth2 Userinfo
OIDC UserInfo endpoint.
Returns user information based on granted scopes.
Deliberately not registered on this router: UserInfo is an OIDC endpoint
and belongs on the OAuth2 mount, next to the discovery document that
advertises it. router_oauth2 registers this same function at
/oauth2/userinfo. Defined here because it is auth-user identity, and to
keep the OAuth2 router free of a second get_current_auth_context import
cycle.
Responses
| Field | Type | Description |
|---|---|---|
| sub* | string | |
| string | null | ||
| email_verified | boolean | null |
Example request
curl -X GET "https://api.davi.social/oauth2/userinfo" \
-H "Authorization: Bearer <token>"