Skip to content
Kapten
Esc
↑↓navigate↵open⌘Jpreview

Create or replace the organization's identity provider

Requires organization:update. Kapten fetches the issuer’s discovery document first, and refuses (400) one it cannot fetch or whose issuer differs. New domains start unverified; domains kept keep their verification. Changing the issuer ends the sessions the former provider started. The provisioning Role must exist and must not grant organization:delete.

PUT/organizations/{organizationId}/sso
Authorization
AuthorizationBearer token (JWT) · headerrequired

An access token issued by this service (RFC 9068), in the Authorization header as Bearer <token>.

Path parameters
organizationIdstring<uuid>required
Request body
requiredapplication/json
issuerstringrequired

An https URL (plain http only when auth itself runs on http, in development).

client_idstringrequired
min length 1
client_secretstring

Required to create a connection; omit it to keep the current secret. Stored encrypted and never returned.

domainsstring[]required
min items 1
enforcedbooleanrequired
provisioning_rolestring

Name of a Role to give on first SSO login; omit or leave empty to turn just-in-time provisioning off.

Responses
200

The saved connection.

issuerstringrequired

The provider's issuer identifier; auth reads {issuer}/.well-known/openid-configuration.

client_idstringrequired
redirect_uristringrequired

The redirect URI to register at the provider, the same for every organization.

domainssso_domain[]required

The organization's email domains, sorted. Once verified, a domain is routed to the provider (home realm discovery), and only verified addresses on verified domains may sign in through it.

Show properties
Array of sso_domain
domainstringrequired
record_namestringrequired

Name of the TXT record to publish, _kapten-sso.<domain>.

record_valuestringrequired

Value of the TXT record.

verified_atstring<date-time>

When the record was found; absent while the domain is unverified and not routed.

enforcedbooleanrequired

Members must sign in through the provider to get tokens for the organization; owners are exempt so a broken provider never locks the organization out.

provisioning_rolestring

Role given to people on their first SSO login (just-in-time provisioning); absent when it is off and only invited people or members can sign in.

created_atstring<date-time>required
updated_atstring<date-time>required
default

The request failed.

errorstringrequired

Stable machine-readable code.

Allowed:invalid_requestunauthorizedforbiddennot_foundconflictgoneunavailableinternal
messagestringrequired

Human-readable explanation.

Request
curl -X PUT 'https://auth.kapten.io/organizations/497f6eca-6276-4993-bfeb-53cbbbba6f08/sso' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "issuer": "string",
  "client_id": "string",
  "client_secret": "string",
  "domains": [
    "string"
  ],
  "enforced": true,
  "provisioning_role": "string"
}'
Response
{
  "issuer": "string",
  "client_id": "string",
  "redirect_uri": "string",
  "domains": [
    {
      "domain": "string",
      "record_name": "string",
      "record_value": "string",
      "verified_at": "2019-08-24T14:15:22Z"
    }
  ],
  "enforced": true,
  "provisioning_role": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}