OIDC token endpoint
POST /api/sso/oidc/token
Exchanges a code using the tenant's enabled OIDC configuration and the single-use state record created by the initiate endpoint. The required code, tenant_id, redirect_uri, 32-character state and 64-character binding are form-encoded; success returns api_token, user_id and email as JSON. Validation, state, exchange and tenant-account failures return 422.
This operation needs no authentication.
Request body
application/x-www-form-urlencoded object
bindingstring requiredThe one-time secret returned as
bindingby the initiate endpoint. A request without it fails validation (422 validation_error); a value that does not match the one stored with the state is rejected with 422 invalid_state and leaves the state unused.Length: 64 to 64 characterscodestring requiredLength: at least 1 charactersredirect_uristring (uri) requiredstatestring requiredLength: 32 to 32 characterstenant_idinteger requiredRange: at least 1
Generated sample
{
"binding": "string",
"code": "string",
"redirect_uri": "https://example.com",
"state": "string",
"tenant_id": 1
}Responses
200 Token response
application/json object
api_tokenstring requiredemailstring (email) requireduser_idinteger required
Generated sample
{
"api_token": "string",
"email": "user@example.com",
"user_id": 0
}422 Invalid request, state, OIDC exchange, or tenant account.
application/json GenericError
erroranyOne of
- string
- object
Any keys are accepted.
error_codestringcodestringmessagestringdetailstringstatusanyOne of
- string
- integer
errorsobjectAny keys are accepted.
429 Route rate limit exceeded.
application/json GenericError
erroranyOne of
- string
- object
Any keys are accepted.
error_codestringcodestringmessagestringdetailstringstatusanyOne of
- string
- integer
errorsobjectAny keys are accepted.
text/html string