Skip to content

Exchange an authorization code for tokens

POST
/api/v1/oidc/token
curl --request POST \
--url https://gpu-kitchen.example.lan/api/v1/oidc/token \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data grant_type=authorization_code \
--data code=example \
--data redirect_uri=example \
--data code_verifier=example \
--data client_id=example \
--data client_secret=example

The OAuth 2.0 token endpoint, for the application’s server. A refusal answers the OAuth 2.0 error object { error, error_description }.

Media typeapplication/x-www-form-urlencoded
object
grant_type
required
string
Allowed value: authorization_code
code
required
string
redirect_uri
required
string
code_verifier
string
client_id
string
client_secret
string

Success.

Media typeapplication/json
object
access_token
required
string
token_type
required
string
Allowed value: Bearer
expires_in
required
integer
>= -9007199254740991 <= 9007199254740991
id_token
required
string
scope
required
string
Example
{
"token_type": "Bearer"
}

Error codes: payload_too_large.

Media typeapplication/json
object
error
required
object
code
required

Stable snake_case code to branch on.

string
message
required

A sentence to show a person.

string
details

Optional structured context.

fix

Optional place where the problem is fixed.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": "example",
"fix": "example"
}
}