Complete REST API documentation for the Authly OAuth 2.1 + OpenID Connect 1.0 authorization server.
Base URL: http://localhost:8000 (development) or your deployment URL
API Version: v1
Standards: OAuth 2.1, OpenID Connect Core 1.0, RFC 6749, RFC 7636 (PKCE), RFC 7009 (Revocation), RFC 8414 (Discovery)
OIDC Conformance: 100% compliant with OpenID Connect Core 1.0 certification tests
Initiates OAuth 2.1 authorization flow with OpenID Connect support and consent UI.
Query Parameters:
response_type string required Must be "code"
client_id string required OAuth client identifier
redirect_uri string required Registered redirect URI
scope string optional Space-separated list of scopes (include "openid" for OIDC)
state string recommended CSRF protection parameter
code_challenge string required PKCE code challenge (base64url, 43-128 chars)
code_challenge_method string optional Must be "S256" (default)
# OpenID Connect Parameters
nonce string optional Nonce for ID token binding
response_mode string optional How to return response (query, fragment, form_post)
display string optional UI display mode (page, popup, touch, wap)
prompt string optional Re-authentication/consent (none, login, consent, select_account)
max_age integer optional Maximum authentication age in seconds
ui_locales string optional Preferred UI languages (space-separated)
id_token_hint string optional ID token hint for logout or re-authentication
login_hint string optional Hint to identify the user
acr_values string optional Authentication Context Class Reference values
Example Request:
GET /api/v1/oauth/authorize?response_type=code&client_id=your-client&redirect_uri=https://app.com/callback&scope=openid%20profile%20email&state=xyz&nonce=abc123&code_challenge=dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk&code_challenge_method=S256Response: HTML consent form for user authorization
Processes user consent and generates authorization code.
Form Data:
username string required User's username
password string required User's password
consent string required Must be "allow"
Success Response:
HTTP/1.1 302 Found
Location: https://app.com/callback?code=auth_code_here&state=xyzError Response:
HTTP/1.1 302 Found
Location: https://app.com/callback?error=access_denied&error_description=User%20denied%20access&state=xyzExchanges authorization code for access tokens, refresh tokens, and ID tokens (when using OpenID Connect).
Headers:
Content-Type: application/x-www-form-urlencoded
Authorization: Basic base64(client_id:client_secret) // For confidential clients
Form Data:
grant_type string required "authorization_code" or "refresh_token"
code string required Authorization code (for authorization_code grant)
redirect_uri string required Must match authorization request
code_verifier string required PKCE code verifier
client_id string required OAuth client identifier
refresh_token string required Refresh token (for refresh_token grant)
Authorization Code Grant Example:
POST /oauth/token
Content-Type: application/x-www-form-urlencoded
Authorization: Basic Y2xpZW50X2lkOmNsaWVudF9zZWNyZXQ=
grant_type=authorization_code&code=auth_code&redirect_uri=https://app.com/callback&code_verifier=dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk&client_id=your-clientSuccess Response:
{
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "def502004c6c4e...",
"scope": "openid profile email",
"id_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9..." // Present when scope includes 'openid'
}Error Response:
{
"error": "invalid_grant",
"error_description": "Invalid authorization code"
}Revokes access or refresh tokens (RFC 7009).
Headers:
Content-Type: application/x-www-form-urlencoded
Authorization: Basic base64(client_id:client_secret)
Form Data:
token string required Token to revoke
token_type_hint string optional "access_token" or "refresh_token"
Example Request:
POST /api/v1/oauth/revoke
Content-Type: application/x-www-form-urlencoded
Authorization: Basic Y2xpZW50X2lkOmNsaWVudF9zZWNyZXQ=
token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...&token_type_hint=access_tokenSuccess Response:
HTTP/1.1 200 OKOAuth 2.1 server metadata (RFC 8414).
Response:
{
"issuer": "http://localhost:8000",
"authorization_endpoint": "http://localhost:8000/api/v1/oauth/authorize",
"token_endpoint": "http://localhost:8000/api/v1/oauth/token",
"revocation_endpoint": "http://localhost:8000/api/v1/oauth/revoke",
"response_types_supported": ["code"],
"grant_types_supported": ["authorization_code", "refresh_token", "password"],
"code_challenge_methods_supported": ["S256"],
"token_endpoint_auth_methods_supported": ["client_secret_basic", "client_secret_post"],
"scopes_supported": ["read", "write", "admin"]
}Retrieve user information using an access token (OIDC Core 1.0 Section 5.3).
Returns user claims based on access token scopes.
Headers:
Authorization: Bearer access_token_here
Example Request:
GET /oidc/userinfo
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...Success Response:
{
"sub": "user123",
"name": "John Doe",
"given_name": "John",
"family_name": "Doe",
"email": "john@example.com",
"email_verified": true
}Error Response:
{
"error": "invalid_token",
"error_description": "The access token is invalid"
}JSON Web Key Set for token signature verification.
Response:
{
"keys": [
{
"kty": "RSA",
"use": "sig",
"kid": "rsa-key-1",
"n": "0vx7agoebGcQSzuuiUiUXqjy...",
"e": "AQAB"
}
]
}OpenID Connect provider configuration.
Response:
{
"issuer": "http://localhost:8000",
"authorization_endpoint": "http://localhost:8000/oauth/authorize",
"token_endpoint": "http://localhost:8000/oauth/token",
"userinfo_endpoint": "http://localhost:8000/oidc/userinfo",
"jwks_uri": "http://localhost:8000/.well-known/jwks.json",
"response_types_supported": ["code"],
"subject_types_supported": ["public"],
"id_token_signing_alg_values_supported": ["RS256", "HS256"],
"scopes_supported": ["openid", "profile", "email"],
"claims_supported": ["sub", "name", "given_name", "family_name", "email", "email_verified"]
}OpenID Connect RP-Initiated Logout endpoint.
Query Parameters:
id_token_hint string optional ID token for identifying the session
post_logout_redirect_uri string optional URI to redirect after logout
state string optional State to maintain through logout
Check current session status.
Response:
{
"session_state": "active",
"sid": "session-id-here"
}Serves the OpenID Connect session management iframe for monitoring session state.
Front-channel logout endpoint for single logout functionality.
Authenticate user and obtain tokens.
Form Data:
grant_type string required "password"
username string required User's username
password string required User's password
scope string optional Requested scopes
Example Request:
POST /auth/token
Content-Type: application/x-www-form-urlencoded
grant_type=password&username=john&password=secret&scope=read%20writeSuccess Response:
{
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "def502004c6c4e...",
"scope": "read write"
}Refresh access token using refresh token.
Form Data:
grant_type string required "refresh_token"
refresh_token string required Valid refresh token
Example Request:
POST /auth/refresh
Content-Type: application/x-www-form-urlencoded
grant_type=refresh_token&refresh_token=def502004c6c4e...Success Response:
{
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "abc123new_refresh...",
"scope": "read write"
}Invalidate user tokens and logout.
Headers:
Authorization: Bearer access_token_here
Example Request:
POST /auth/logout
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...Success Response:
{
"message": "Successfully logged out"
}All admin endpoints require authentication and admin privileges.
Authenticate for admin API access.
Request Body:
{
"username": "admin",
"password": "admin_password"
}Success Response:
{
"access_token": "admin_jwt_token...",
"token_type": "Bearer",
"expires_in": 3600
}List OAuth clients.
Headers:
Authorization: Bearer admin_token
Query Parameters:
limit integer optional Number of clients to return (default: 20)
offset integer optional Pagination offset (default: 0)
active boolean optional Filter by active status
Success Response:
{
"clients": [
{
"id": "client-uuid",
"client_id": "my-app",
"client_name": "My Application",
"client_type": "confidential",
"redirect_uris": ["https://myapp.com/callback"],
"is_active": true,
"created_at": "2025-07-10T10:00:00Z"
}
],
"total": 1,
"limit": 20,
"offset": 0
}Create new OAuth client.
Request Body:
{
"client_name": "My Application",
"client_type": "confidential",
"redirect_uris": ["https://myapp.com/callback"],
"scopes": ["read", "write"]
}Success Response:
{
"id": "client-uuid",
"client_id": "generated-client-id",
"client_secret": "generated-secret",
"client_name": "My Application",
"client_type": "confidential",
"redirect_uris": ["https://myapp.com/callback"],
"scopes": ["read", "write"],
"is_active": true,
"created_at": "2025-07-10T10:00:00Z"
}Get specific OAuth client details.
Success Response:
{
"id": "client-uuid",
"client_id": "my-app",
"client_name": "My Application",
"client_type": "confidential",
"redirect_uris": ["https://myapp.com/callback"],
"scopes": ["read", "write"],
"is_active": true,
"created_at": "2025-07-10T10:00:00Z"
}Update OAuth client.
Request Body:
{
"client_name": "Updated Application Name",
"redirect_uris": ["https://myapp.com/callback", "https://myapp.com/callback2"],
"is_active": true
}Regenerate client secret (confidential clients only).
Success Response:
{
"client_secret": "new-generated-secret"
}Deactivate OAuth client.
Success Response:
HTTP/1.1 204 No ContentList OAuth scopes.
Success Response:
{
"scopes": [
{
"id": "scope-uuid",
"scope_name": "read",
"description": "Read access to user data",
"is_default": false,
"is_active": true,
"created_at": "2025-07-10T10:00:00Z"
}
]
}Create new OAuth scope.
Request Body:
{
"scope_name": "read",
"description": "Read access to user data",
"is_default": false
}Get specific scope details.
Update OAuth scope.
Deactivate OAuth scope.
List users (admin only).
Query Parameters:
limit integer optional Number of users to return
offset integer optional Pagination offset
active boolean optional Filter by active status
admin boolean optional Filter by admin status
Success Response:
{
"users": [
{
"id": "user-uuid",
"username": "john",
"email": "john@example.com",
"is_active": true,
"is_admin": false,
"is_verified": true,
"created_at": "2025-07-10T10:00:00Z",
"last_login": "2025-07-10T12:00:00Z"
}
],
"total": 1
}Get system status and configuration.
Success Response:
{
"status": "healthy",
"version": "1.0.0",
"database": {
"status": "connected",
"pool_size": 10,
"active_connections": 2
},
"oauth": {
"clients_count": 5,
"scopes_count": 8,
"active_tokens": 12
},
"uptime": "2 days, 5 hours"
}Basic application health check.
Success Response:
{
"status": "healthy",
"timestamp": "2025-07-10T10:00:00Z"
}Kubernetes readiness probe.
Success Response:
{
"status": "ready",
"database": "connected",
"timestamp": "2025-07-10T10:00:00Z"
}Kubernetes liveness probe.
Success Response:
{
"status": "alive",
"timestamp": "2025-07-10T10:00:00Z"
}All API errors follow this format:
{
"error": "error_code",
"error_description": "Human-readable error description",
"error_uri": "https://docs.authly.com/errors/error_code"
}200- Success201- Created204- No Content400- Bad Request401- Unauthorized403- Forbidden404- Not Found422- Unprocessable Entity429- Too Many Requests500- Internal Server Error
invalid_request- The request is missing a required parameterinvalid_client- Client authentication failedinvalid_grant- The provided authorization grant is invalidunauthorized_client- The client is not authorized to request a tokenunsupported_grant_type- The authorization grant type is not supportedinvalid_scope- The requested scope is invalid or unknownaccess_denied- The resource owner or authorization server denied the request
Most endpoints require Bearer token authentication:
Authorization: Bearer your_access_token_hereOAuth client authentication uses HTTP Basic:
Authorization: Basic base64(client_id:client_secret)Admin endpoints require admin JWT tokens obtained via /admin/auth.
- Default Limit: 100 requests per minute per IP
- Admin Endpoints: 60 requests per minute per authenticated user
- Token Endpoint: 20 requests per minute per client
Rate limit headers:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1625097600
Rate limit exceeded response:
{
"error": "rate_limit_exceeded",
"error_description": "Too many requests. Please retry later.",
"retry_after": 60
}This API reference covers all endpoints in the Authly OAuth 2.1 + OpenID Connect 1.0 authorization server. For integration examples and advanced usage, see the OAuth Guide and OIDC Guide.