Skip to content

OAuth Endpoints

Paylent implements the OAuth 2.0 and OpenID Connect specifications. These endpoints handle authorization, token exchange, introspection, and discovery.

GET /.well-known/openid-configuration

Returns the OIDC discovery document with all supported endpoints, grant types, and signing algorithms.

OAuth Authorization Server Metadata (RFC 8414)

Section titled “OAuth Authorization Server Metadata (RFC 8414)”
GET /.well-known/oauth-authorization-server

Returns the OAuth 2.0 Authorization Server Metadata document (RFC 8414). This is similar to the OIDC discovery document but follows the OAuth-specific standard. Includes "resource_indicators_supported": true (RFC 8707).

GET /.well-known/jwks.json

Returns the public signing keys for JWT verification. Use this to validate access tokens locally without calling the introspection endpoint.

GET /oauth/authorize

Initiates the authorization code flow. The user must have an active session.

ParameterRequiredDescription
response_typeYesMust be code
client_idYesThe OAuth client’s ID
redirect_uriYesMust match a registered redirect URI
scopeNoSpace-separated list of scopes
stateRecommendedOpaque value for CSRF protection
resourceNoResource server identifier (RFC 8707). Sets the aud claim and token TTL. See API Resources
code_challengeRecommendedPKCE code challenge
code_challenge_methodRecommendedMust be S256

On success, redirects to the redirect_uri with code and state query parameters.

POST /oauth/token

Exchanges credentials for access tokens. Requires client authentication via HTTP Basic Auth (client_id:client_secret).

ParameterRequiredDescription
grant_typeYesauthorization_code
codeYesThe authorization code
redirect_uriYesMust match the original request
code_verifierIf PKCEThe PKCE code verifier
ParameterRequiredDescription
grant_typeYesclient_credentials
scopeNoRequested scopes
resourceYesResource server identifier. Required for client credentials — the client must have a grant for this resource server
ParameterRequiredDescription
grant_typeYesrefresh_token
refresh_tokenYesThe refresh token
{
"access_token": "eyJhbGciOiJSUzI1NiIs...",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "dGhpcyBpcyBhIHJlZnJlc2g..."
}
POST /oauth/introspect

Validates a token and returns its metadata. Requires client authentication.

ParameterRequiredDescription
tokenYesThe token to introspect
{
"active": true,
"scope": "openid profile",
"client_id": "CLIENT_ID",
"token_type": "Bearer",
"exp": 1707400000,
"sub": "USER_ID"
}
{
"active": false
}
POST /oauth/revoke

Revokes an access or refresh token. Requires client authentication.

ParameterRequiredDescription
tokenYesThe token to revoke

Returns 200 OK on success (even if the token was already revoked or invalid, per RFC 7009).

GET /oauth/userinfo
POST /oauth/userinfo

Returns claims about the authenticated user. Requires a valid Bearer token in the Authorization header.

Terminal window
curl https://acme-test.paylent.com/oauth/userinfo \
-H "Authorization: Bearer ACCESS_TOKEN"
GET /auth/sso/:connection_id

Initiates an SSO login flow by redirecting the user to the configured provider. The connection_id identifies which Connection to use.

GET /auth/sso/callback

Handles the callback from the SSO provider after the user authenticates. This endpoint is not called directly — it is the redirect URI registered with the provider.