Skip to content
Sign in Create account

Initiate OIDC SSO flow (POST variant)

POST /api/auth/sso/oidc/initiate

Accepts tenant_id and redirect_uri in a JSON request body and returns auth_url, state and binding as JSON. Both values are validated; tenant_id must be a positive integer and redirect_uri a URL of at most 2048 characters. The enabled OIDC configuration must exist. This route is unauthenticated and limited to 20 requests per minute per IP.

This operation needs no authentication.

Request body

application/json object

  • redirect_uri string (uri) required
    Length: at most 2048 characters
  • tenant_id integer required
    Range: at least 1

Generated sample

{
  "redirect_uri": "https://example.com",
  "tenant_id": 1
}

Responses

200 Authorization URL, single-use state and client-held binding returned.

application/json object

  • auth_url string (uri) required
  • binding string required

    One-time client-held secret (64 hex characters). Keep it in the client that started the sign-in and send it to the OIDC token endpoint together with the code and state.

    Length: 64 to 64 characters
  • state string required

Generated sample

{
  "auth_url": "https://example.com",
  "binding": "string",
  "state": "string"
}
422 OIDC is not configured or the request is invalid.

application/json object

  • error string required
429 Route rate limit exceeded.

Response headers

  • Retry-After string header
  • X-RateLimit-Scope string header

application/json object

  • error object required
    • code string required
      Value: "too_many_attempts"
    • scope string required
      Value: "route"
    • message string required
    • retry_after_s integer required
      Range: at least 1

text/html string

502 OIDC initiation failed.

application/json object

  • error string required
    Value: "oidc_initiate_failed"
  • detail string required
  • ref string required