Skip to content
Sign in Create account

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

  • binding string required

    The one-time secret returned as binding by 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 characters
  • code string required
    Length: at least 1 characters
  • redirect_uri string (uri) required
  • state string required
    Length: 32 to 32 characters
  • tenant_id integer required
    Range: 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_token string required
  • email string (email) required
  • user_id integer 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

  • error any

    One of

    • string
    • object

      Any keys are accepted.

  • error_code string
  • code string
  • message string
  • detail string
  • status any

    One of

    • string
    • integer
  • errors object

    Any keys are accepted.

429 Route rate limit exceeded.

application/json GenericError

  • error any

    One of

    • string
    • object

      Any keys are accepted.

  • error_code string
  • code string
  • message string
  • detail string
  • status any

    One of

    • string
    • integer
  • errors object

    Any keys are accepted.

text/html string