Download OpenAPI specification:Download
OpenAPI specification for the ID Gateway authentication endpoints.
The API follows an OAuth2-style authorization code flow (OIDC-lite) with endpoints for initiating authorization, exchanging authorization codes for tokens, and fetching user information for an authenticated session.
Per-Tenant Issuer (RFC 8414 Compliance):
Each tenant has a unique issuer URL following the format: {base_url}/tenants/{tenant_id}
Example: https://auth.credo.io/tenants/550e8400-e29b-41d4-a716-446655440000
The iss claim in access tokens and ID tokens uses this per-tenant issuer format.
The tenant_id is also included as a custom claim in access tokens for client convenience.
Exchanges a valid authorization code (FR-1) or refresh token (FR-2)
for new tokens. For authorization code exchange, the redirect_uri
and client_id must match the authorize request. For refresh grant,
provide a valid refresh token and the client_id.
Rate Limiting:
This endpoint is rate-limited by client_id + IP to prevent credential stuffing.
When rate limited, the response includes a Retry-After header indicating
when to retry.
Error Handling (RFC 6749 §5.2):
invalid_grantinvalid_grantinvalid_grantinvalid_clientvalidation_errorbad_request| grant_type required | string Value: "authorization_code" Must be |
| code required | string Authorization code received from |
| redirect_uri required | string <uri> Redirect URI that matches the authorize call |
| client_id required | string OAuth client identifier used during authorization |
{- "grant_type": "authorization_code",
- "code": "authz_cafedeadbeef",
- "client_id": "demo-client"
}{- "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
- "id_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
- "refresh_token": "ref_7c9e6679-7425-40de-944b-e07fc1f90ae7",
- "token_type": "Bearer",
- "expires_in": 3600,
- "scope": "openid profile"
}Implements RFC 7009 token revocation (FR-3). Accepts either access token (JWT) or refresh token (opaque). Idempotent.
| token required | string Token to revoke (access or refresh) |
| client_id | string OAuth client identifier (optional per RFC 7009, required for public clients) |
| token_type_hint | string Enum: "access_token" "refresh_token" Optional hint for token type |
{- "token": "ref_7c9e6679-7425-40de-944b-e07fc1f90ae7",
- "token_type_hint": "refresh_token"
}{- "revoked": true,
- "message": "string"
}{- "sessions": [
- {
- "session_id": "string",
- "device": "string",
- "location": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "last_activity": "2019-08-24T14:15:22Z",
- "is_current": true,
- "status": "active"
}
]
}