CAPTIVO ID

Developer documentation

Let your organisation's application sign people in with Captivo ID: standard OpenID Connect, authorization code + PKCE.

1 · Register the application

On your account page: Applications → New application. Enter the name and redirect URIs; you receive a client id and a client secret shown once. Keep the secret on your application's server side; never hand it to the browser.

2 · Endpoints

Every OIDC library finds the rest from this document:

EndpointValue
issuerhttps://id.captivo.io
discoveryhttps://id.captivo.io/.well-known/openid-configuration
authorizationhttps://id.captivo.io/auth
tokenhttps://id.captivo.io/token
userinfohttps://id.captivo.io/me
jwkshttps://id.captivo.io/jwks
end_sessionhttps://id.captivo.io/session/end

3 · The sign-in flow

  1. Send the user to the authorization endpoint: response_type=code, scope=openid email profile org, state, nonce, PKCE (code_challenge_method=S256).
  2. Captivo ID verifies the person (password, passkey or the organisation's own provider; with the two-step rules) and returns to your redirect URI with a code.
  3. From your server, post code, code_verifier and your client credentials (HTTP Basic) to the token endpoint; you receive an ID token and an access token.
  4. Verify the ID token against the JWKS (iss, aud = client id, nonce, exp). Start the session.

4 · Claims

The ID token and userinfo carry the following; each claim comes with the scope beside it. amr is in the ID token only.

ClaimScopeMeaning
subopenidThe person's permanent id; unchanged if the e-mail changes.
amropenidHow they were verified; the values are below.
emailemailThe verified e-mail address.
email_verifiedemailAlways true: an unverified address cannot sign in.
nameprofileFull name, when known.
orgorgThe id of the organisation the app is registered in.
org_nameorgThe organisation's name.
roleorgThe person's role in the organisation: OWNER, ADMIN, MEMBER; null if not a member.

The amr values. To decide whether a second step was taken, look for otp or mfa.

pwdPassword.
otpAn authenticator code or a recovery code.
trustedThe person had ticked "don't ask again on this device for 30 days" in this browser, so no code was asked this time (comes with pwd and otp).
passkeySigned in with a passkey.
mfaTwo factors were taken; e.g. a passkey unlocked with the device's lock, or MFA reported by the enterprise provider.
fedSigned in through the organisation's own identity provider; the provider's own amr values are kept too.

5 · Who may sign in

With "members only" (the default) only accepted members of your organisation receive a token; anyone else is refused even after verifying their identity. With it off, anyone with a Captivo account signs in and role is null for non-members. Tick groups for the app under Groups and access on the organisation page and only their members sign in; that rule requires membership whatever the switch says.

6 · Sign-out

Send the user to the end_session_endpoint with id_token_hint and a registered post_logout_redirect_uri.

Example (curl)

# 1. Send the browser here (your library builds this)
https://id.captivo.io/auth?response_type=code&client_id=app_xxx&redirect_uri=https%3A%2F%2Fapp.example%2Fcallback
  &scope=openid%20email%20profile%20org&state=...&nonce=...&code_challenge=...&code_challenge_method=S256

# 2. Exchange the code on your server
curl -u 'app_xxx:CLIENT_SECRET' https://id.captivo.io/token \
  -d grant_type=authorization_code -d code=CODE -d code_verifier=VERIFIER \
  -d redirect_uri=https://app.example/callback

# 3. Read the person
curl -H 'Authorization: Bearer ACCESS_TOKEN' https://id.captivo.io/me

SAML 2.0 applications

For applications that do not speak OpenID Connect (Jira, Salesforce, AWS…) Captivo ID is a SAML 2.0 identity provider.

  1. On your account page: Applications → New SAML application. Enter the application's Entity ID and ACS address, or paste the application's metadata.
  2. Give the application the metadata address shown after registering. For applications that take no metadata, enter the SSO address, the Entity ID and the signing certificate you download.
  3. Sign-in starts at the application (SP-initiated; HTTP-Redirect or HTTP-POST). The person signs in at Captivo ID under your organisation's rules (two-step verification, enterprise sign-in) and the signed response is posted to the registered ACS address.
NameIDThe e-mail address (emailAddress format).
email, name, firstName, lastNameThe person's address and name.
role, organizationTheir role in the organisation (OWNER / ADMIN / MEMBER) and its name; left out for non-members.
SignatureBoth the Response and the Assertion, RSA-SHA256.
AuthnContexthttps://refeds.org/profile/mfa after a two-step sign-in, PasswordProtectedTransport otherwise.
Not supportedSAML single logout, encrypted assertions, IdP-initiated sign-in.

Admin API

Let your organisation's own systems (HR, directory, scripts) manage members and groups and read the activity log. Create a key under Admin API keys on the organisation page (owners only); it is shown once. Send Authorization: Bearer cid_… with every request.

EndpointBody
GET/api/v1/organization—
GET/api/v1/members—
GET/api/v1/members/{id}—
POST/api/v1/members{"email": "…", "role": "MEMBER"}
PATCH/api/v1/members/{id}{"role": "ADMIN"} · {"suspended": true} · {"expiresAt": "2026-12-31T21:00:00Z" | null}
DELETE/api/v1/members/{id}—
POST/api/v1/members/{id}/reset-two-step—
GET/api/v1/audit?since=2026-11-01T00:00:00Z&limit=500—
GET/api/v1/groups—
POST/api/v1/groups{"name": "Finance"}
DELETE/api/v1/groups/{id}—
POST/api/v1/groups/{id}/members{"member": "<member id>"}
DELETE/api/v1/groups/{id}/members/{member id}—
ScopeA read key only GETs; a write key acts with an owner's authority. The last owner cannot be removed or demoted.
LoggingEvery change is written to the activity log as api:<key name> and pushed to Captivo Portal and Access at once.
Limit300 requests a minute per key; beyond that 429 with Retry-After.
ErrorsJSON: {"error": "code", "message": "…"}; 401 bad key, 403 not allowed, 404 not found, 409 refused by a rule.
InvitationsPOST /members answers 201: {"id", "email", "role", "status": "invited", "inviteLink", "mailed"}. The link works for 7 days; with mailed false no e-mail went out, so pass the link on yourself.
Activity logWithout since, the last 7 days; limit defaults to 500, at most 1000. Newest first.
curl -H "Authorization: Bearer cid_…" https://id.captivo.io/api/v1/members

curl -X POST -H "Authorization: Bearer cid_…" -H "Content-Type: application/json" \
  -d '{"email":"ayse@firma.com","role":"MEMBER"}' https://id.captivo.io/api/v1/members

SCIM 2.0

Entra ID and Okta write the organisation's people and groups to this address. The token is created on the enterprise sign-in page and sent as Authorization: Bearer … with every request. Setup steps are in the setup guide.

URLhttps://id.captivo.io/scim/v2
DiscoveryGET /ServiceProviderConfig, /ResourceTypes and /Schemas; these need the token too.
Resources/Users and /Groups: GET, POST, PUT, PATCH, DELETE.
Filterattr eq "value" only. Users: userName, emails.value, externalId, id, active. Groups: displayName, externalId, id. At most 200 results a page.
AddressuserName must be an e-mail address under one of the organisation's verified domains.
Limit600 requests a minute per organisation.
Not supportedBulk, sorting, ETags, password change.

Event stream (SIEM)

The organisation's owner gives an HTTPS receiver address under Event stream (SIEM) on the organisation page; the activity log is POSTed there every minute. The signing secret (whsec_…) is shown once, when the stream starts.

BodyA JSON array (application/json) or one event per line, NDJSON (application/x-ndjson). At most 200 events a request, oldest first.
Eventid, at (ISO 8601), action, organizationId, actor, subject, ip, details.
X-Captivo-TimestampWhen it was sent, Unix time in seconds.
X-Captivo-Signaturev1= followed by HMAC-SHA256(secret, "<X-Captivo-Timestamp>.<body>"), in hex.
AuthorizationSent as typed, if you gave one when creating the stream (e.g. a Splunk HEC token).
DeliveryOnly a 2xx counts. With no answer in 10 seconds or any other status, the same events are retried after 1, 2, 4… minutes (at least once an hour); redirects are not followed. An event can arrive twice; deduplicate on id.
Test"Send a test event" sends a single event whose action is stream.test.

Verify the signature over the raw body (Node.js):

import { createHmac, timingSafeEqual } from "node:crypto";

// rawBody: the request body exactly as received, before any JSON parsing
const ts = req.headers["x-captivo-timestamp"];
const expected = "v1=" + createHmac("sha256", process.env.CAPTIVO_STREAM_SECRET)
  .update(`${ts}.${rawBody}`).digest("hex");
const got = String(req.headers["x-captivo-signature"] ?? "");
const ok = got.length === expected.length && timingSafeEqual(Buffer.from(got), Buffer.from(expected));

← Account page