OAuth and OpenID Connect
The authorization server: authorization, tokens, introspection, revocation, UserInfo, consents and client registration.
Authorize an OAuth 2.1 request from query parameters or an application/x-www-form-urlencoded POST body
response_type?stringOAuth 2.1 response type (e.g., 'code')
client_id*stringOAuth 2.1 client ID
redirect_uri?stringOAuth 2.1 redirect URI
uriscope?stringOAuth 2.1 scopes (space-separated)
state?stringOAuth 2.1 state parameter
request_uri?stringPushed Authorization Request URI referencing stored parameters
code_challenge?stringPKCE code challenge
code_challenge_method?stringPKCE code challenge method
nonce?stringOpenID Connect nonce
max_age?integerMaximum authentication age in seconds; forces re-authentication when exceeded
0 <= valueresource?array<string>Requested protected resource(s) for the access token. May be supplied multiple times as repeated 'resource' query parameters (RFC 8707) or as an array of strings.
prompt?stringOAuth2 prompt parameter
Redirect to client with code or error
curl -X GET 'https://auth.example.com/api/auth/oauth2/authorize?client_id=string'Authorize an OAuth 2.1 request from query parameters or an application/x-www-form-urlencoded POST body
response_type?stringOAuth 2.1 response type (e.g., 'code')
client_id*stringOAuth 2.1 client ID
redirect_uri?stringOAuth 2.1 redirect URI
uriscope?stringOAuth 2.1 scopes (space-separated)
state?stringOAuth 2.1 state parameter
request_uri?stringPushed Authorization Request URI referencing stored parameters
code_challenge?stringPKCE code challenge
code_challenge_method?stringPKCE code challenge method
nonce?stringOpenID Connect nonce
max_age?integerMaximum authentication age in seconds; forces re-authentication when exceeded
0 <= valueresource?array<string>Requested protected resource(s) for the access token. May be supplied multiple times as repeated 'resource' query parameters (RFC 8707) or as an array of strings.
prompt?stringOAuth2 prompt parameter
Redirect to client with code or error
curl -X POST 'https://auth.example.com/api/auth/oauth2/authorize?client_id=string'Handle OAuth2 consent
application/json- body
accept*booleanAccept or deny user consent for a set of scopes
scope?stringclaims?string|oauth_query?stringConsent processed successfully
application/json- response
redirect*trueAlways true. Indicates the caller should redirect to url.
trueurl*stringThe absolute or relative URI to redirect to next.
uri-referencecurl -X POST 'https://auth.example.com/api/auth/oauth2/consent' \ -H 'Content-Type: application/json' \ -d '{ "accept": true}'{ "redirect": true, "url": "../dictionary"}Continues OAuth2 authorization flow
application/json- body
selected?booleancreated?booleanpostLogin?booleanoauth_query?stringAuthorization flow continued successfully
application/json- response
redirect*trueAlways true. Indicates the caller should redirect to url.
trueurl*stringThe absolute or relative URI to redirect to next.
uri-referencecurl -X POST 'https://auth.example.com/api/auth/oauth2/continue' \ -H 'Content-Type: application/json' \ -d '{}'{ "redirect": true, "url": "../dictionary"}Obtain an OAuth2.1 access token
DPoP?stringRFC 9449 DPoP proof JWT for issuing DPoP-bound tokens
application/json- body
grant_type*stringOAuth2 grant type
client_id?stringOAuth2 client ID
client_secret?stringOAuth2 client secret
code?stringAuthorization code (for authorization_code grant)
code_verifier?stringPKCE code verifier (for authorization_code grant)
redirect_uri?stringRedirect URI (for authorization_code grant)
urirefresh_token?stringRefresh token (for refresh_token grant)
resource?|array<string>Requested protected resource(s) for the access token
scope?stringRequested scopes (for client_credentials grant)
Access token response
application/json- response
access_token*stringThe access token issued by the authorization server
token_type*stringThe type of the token issued
"Bearer""DPoP"expires_in*numberLifetime in seconds of the access token
refresh_token?stringRefresh token, if issued
scope?stringScopes granted by the access token
id_token?stringID Token (if OpenID Connect)
curl -X POST 'https://auth.example.com/api/auth/oauth2/token' \ -H 'Content-Type: application/json' \ -d '{ "grant_type": "string"}'{ "access_token": "string", "token_type": "Bearer", "expires_in": 0, "refresh_token": "string", "scope": "string", "id_token": "string"}Introspect an OAuth2 access or refresh token
application/json- body
client_id?stringOAuth2 client ID
client_secret?stringOAuth2 client secret
token*stringThe token to introspect (access or refresh token)
token_type_hint?stringHint about the token type. Recognized values: access_token, refresh_token.
Token introspection response
application/json- response
active*booleanWhether the token is active
scope?stringScopes associated with the token
client_id?stringClient ID associated with the token
username?stringUsername associated with the token
token_type?stringType of the token
exp?numberExpiration time of the token (seconds since epoch)
iat?numberIssued at time (seconds since epoch)
nbf?numberNot before time (seconds since epoch)
sub?stringSubject of the token
aud?stringAudience of the token
iss?stringIssuer of the token
jti?stringJWT ID
curl -X POST 'https://auth.example.com/api/auth/oauth2/introspect' \ -H 'Content-Type: application/json' \ -d '{ "token": "string"}'{ "active": true, "scope": "string", "client_id": "string", "username": "string", "token_type": "string", "exp": 0, "iat": 0, "nbf": 0, "sub": "string", "aud": "string", "iss": "string", "jti": "string"}Revoke an OAuth2 access or refresh token
application/json- body
client_id?stringOAuth2 client ID
client_secret?stringOAuth2 client secret
token*stringThe token to revoke (access or refresh token)
token_type_hint?stringHint about the token type. Recognized values: access_token, refresh_token.
Token revoked successfully. The response body is empty.
application/json- response
Empty object on success
curl -X POST 'https://auth.example.com/api/auth/oauth2/revoke' \ -H 'Content-Type: application/json' \ -d '{ "token": "string"}'{}Get OpenID Connect user information (UserInfo endpoint)
DPoP?stringRFC 9449 DPoP proof JWT when using a DPoP-bound access token
User information retrieved successfully
application/json- response
sub*stringSubject identifier (user ID)
email?stringUser's email address, included if 'email' scope is granted
emailname?stringUser's full name, included if 'profile' scope is granted
picture?stringUser's profile picture URL, included if 'profile' scope is granted
urigiven_name?stringUser's given name, included if 'profile' scope is granted
family_name?stringUser's family name, included if 'profile' scope is granted
email_verified?booleanWhether the email is verified, included if 'email' scope is granted
curl -X GET 'https://auth.example.com/api/auth/oauth2/userinfo'{ "sub": "string", "email": "user@example.com", "name": "string", "picture": "http://example.com", "given_name": "string", "family_name": "string", "email_verified": true}Get OpenID Connect user information (UserInfo endpoint)
DPoP?stringRFC 9449 DPoP proof JWT when using a DPoP-bound access token
application/json- body
access_token?stringUser information retrieved successfully
application/json- response
sub*stringSubject identifier (user ID)
email?stringUser's email address, included if 'email' scope is granted
emailname?stringUser's full name, included if 'profile' scope is granted
picture?stringUser's profile picture URL, included if 'profile' scope is granted
urigiven_name?stringUser's given name, included if 'profile' scope is granted
family_name?stringUser's family name, included if 'profile' scope is granted
email_verified?booleanWhether the email is verified, included if 'email' scope is granted
curl -X POST 'https://auth.example.com/api/auth/oauth2/userinfo' \ -H 'Content-Type: application/json' \ -d '{}'{ "sub": "string", "email": "user@example.com", "name": "string", "picture": "http://example.com", "given_name": "string", "family_name": "string", "email_verified": true}RP-Initiated Logout endpoint. Accepts standard logout parameters through GET or an application/x-www-form-urlencoded POST body, plus JSON for Better Auth generated-client calls. Requests without a usable id_token_hint may require explicit OP confirmation.
id_token_hint?stringclient_id?stringpost_logout_redirect_uri?stringstate?stringLogout completed, or an HTML confirmation page was returned for browser navigation. A redirect is used only for an exact registered post_logout_redirect_uri.
- response
redirect_uri?stringURI to redirect to after logout (if post_logout_redirect_uri was provided)
urimessage?stringSuccess message
curl -X GET 'https://auth.example.com/api/auth/oauth2/end-session'{ "redirect_uri": "http://example.com", "message": "string"}RP-Initiated Logout endpoint. Accepts standard logout parameters through GET or an application/x-www-form-urlencoded POST body, plus JSON for Better Auth generated-client calls. Requests without a usable id_token_hint may require explicit OP confirmation.
id_token_hint?stringclient_id?stringpost_logout_redirect_uri?stringstate?stringapplication/json- body
id_token_hint?stringclient_id?stringpost_logout_redirect_uri?stringstate?stringLogout completed, or an HTML confirmation page was returned for browser navigation. A redirect is used only for an exact registered post_logout_redirect_uri.
- response
redirect_uri?stringURI to redirect to after logout (if post_logout_redirect_uri was provided)
urimessage?stringSuccess message
curl -X POST 'https://auth.example.com/api/auth/oauth2/end-session' \ -H 'Content-Type: application/json' \ -d '{}'{ "redirect_uri": "http://example.com", "message": "string"}application/json- body
action*"confirm""confirm"Bad Request. Usually due to missing parameters, or invalid parameters.
application/json- response
message*stringcurl -X POST 'https://auth.example.com/api/auth/oauth2/end-session/confirm' \ -H 'Content-Type: application/json' \ -d '{ "action": "confirm"}'{ "message": "string"}Register an OAuth2 application
application/json- body
redirect_uris?array<string>scope?stringclient_name?stringclient_uri?stringlogo_uri?stringcontacts?array<>tos_uri?stringpolicy_uri?stringsoftware_id?stringsoftware_version?stringsoftware_statement?stringpost_logout_redirect_uris?array<string>backchannel_logout_uri?stringbackchannel_logout_session_required?booleantoken_endpoint_auth_method?string1 <= lengthjwks?jwks_uri?stringgrant_types?array<>response_types?array<>application_type?string"web""native"subject_type?string"public""pairwise"dpop_bound_access_tokens?booleanresources?array<string>skip_consent?stringOAuth2 application registered successfully
application/json- response
client_id*stringUnique identifier for the client
client_secret?stringSecret key for the client
client_secret_expires_at?numberTime the client secret will expire. If 0, the client secret will never expire.
scope?stringSpace-separated scopes allowed by the client
user_id?stringID of the user who registered the client, null if registered anonymously
client_id_issued_at?numberCreation timestamp of this client
client_name?stringName of the OAuth2 application
client_uri?stringName of the OAuth2 application
logo_uri?stringIcon URL for the application
contacts?array<string>List representing ways to contact people responsible for this client, typically email addresses
tos_uri?stringClient's terms of service uri
policy_uri?stringClient's policy uri
software_id?stringUnique identifier assigned by the developer to help in the dynamic registration process
software_version?stringVersion identifier for the software_id
software_statement?stringJWT containing metadata values about the client software as claims
redirect_uris?array<>List of allowed redirect uris
post_logout_redirect_uris?array<>List of allowed logout redirect uris
backchannel_logout_uri?stringRP URL to receive signed Logout Tokens when the end-user's OP session terminates
uribackchannel_logout_session_required?booleanWhether the RP requires a sid claim in every Logout Token
token_endpoint_auth_method?stringRequested authentication method for the token endpoint
grant_types?array<string>Grant types the client may use at the token endpoint
response_types?array<>Response types the client may use at the authorization endpoint
application_type?stringOIDC application type used to classify redirect URI policy
"web""native"resources?array<>Final resource identifiers linked to the registered client
disabled?booleanWhether the client is disabled
curl -X POST 'https://auth.example.com/api/auth/oauth2/register' \ -H 'Content-Type: application/json' \ -d '{}'{ "client_id": "string", "client_secret": "string", "client_secret_expires_at": 0, "scope": "string", "user_id": "string", "client_id_issued_at": 0, "client_name": "string", "client_uri": "string", "logo_uri": "string", "contacts": [ "string" ], "tos_uri": "string", "policy_uri": "string", "software_id": "string", "software_version": "string", "software_statement": "string", "redirect_uris": [ "http://example.com" ], "post_logout_redirect_uris": [ "http://example.com" ], "backchannel_logout_uri": "http://example.com", "backchannel_logout_session_required": true, "token_endpoint_auth_method": "string", "grant_types": [ "string" ], "response_types": [ "code" ], "application_type": "web", "resources": [ "http://example.com" ], "disabled": true}Get OAuth2 formatted client details
client_id?stringBad Request. Usually due to missing parameters, or invalid parameters.
application/json- response
message*stringcurl -X GET 'https://auth.example.com/api/auth/oauth2/get-client'{ "message": "string"}Gets publicly available client fields
client_id?stringBad Request. Usually due to missing parameters, or invalid parameters.
application/json- response
message*stringcurl -X GET 'https://auth.example.com/api/auth/oauth2/public-client'{ "message": "string"}Gets publicly available client fields (prior to login)
application/json- body
client_id*stringoauth_query?stringBad Request. Usually due to missing parameters, or invalid parameters.
application/json- response
message*stringcurl -X POST 'https://auth.example.com/api/auth/oauth2/public-client-prelogin' \ -H 'Content-Type: application/json' \ -d '{ "client_id": "string"}'{ "message": "string"}Get OAuth2 formatted client details for a user or organization
Bad Request. Usually due to missing parameters, or invalid parameters.
application/json- response
message*stringcurl -X GET 'https://auth.example.com/api/auth/oauth2/get-clients'{ "message": "string"}Replaces the signing keys of a private_key_jwt client. The request is authenticated by a client assertion signed with one of the client's current keys and addressed to this endpoint. Keys left out of the new set stop verifying at once.
application/json- body
client_assertion*stringclient_assertion_type*stringjwks*Bad Request. Usually due to missing parameters, or invalid parameters.
application/json- response
message*stringcurl -X POST 'https://auth.example.com/api/auth/oauth2/client/rotate-keys' \ -H 'Content-Type: application/json' \ -d '{ "client_assertion": "string", "client_assertion_type": "string", "jwks": { "keys": [ { "property1": null, "property2": null } ] }}'{ "message": "string"}Gets details of a specific OAuth2 consent for a user
id?stringBad Request. Usually due to missing parameters, or invalid parameters.
application/json- response
message*stringcurl -X GET 'https://auth.example.com/api/auth/oauth2/get-consent'{ "message": "string"}Gets all available OAuth2 consents for a user
Bad Request. Usually due to missing parameters, or invalid parameters.
application/json- response
message*stringcurl -X GET 'https://auth.example.com/api/auth/oauth2/get-consents'{ "message": "string"}Updates consent granted to a client.
application/json- body
id*stringupdate*Bad Request. Usually due to missing parameters, or invalid parameters.
application/json- response
message*stringcurl -X POST 'https://auth.example.com/api/auth/oauth2/update-consent' \ -H 'Content-Type: application/json' \ -d '{ "id": "string", "update": { "scopes": [ "string" ] }}'{ "message": "string"}Deletes consent granted to a client
application/json- body
id*stringBad Request. Usually due to missing parameters, or invalid parameters.
application/json- response
message*stringcurl -X POST 'https://auth.example.com/api/auth/oauth2/delete-consent' \ -H 'Content-Type: application/json' \ -d '{ "id": "string"}'{ "message": "string"}