Authentication Flows
This page describes the end-to-end sequence for both SSO protocols, what Consentio validates at each step, and how long the resulting session lasts.
Both flows are SP-initiated and converge on the same final step: the API issues a single-use authorization code, the browser carries it to the application, and the application exchanges it for a token pair.
OIDC flow
OpenID Connect uses the authorization code flow with PKCE, completed on the Consentio backend.
OIDC step by step
| Step | Action | Endpoint |
|---|---|---|
| 1 | User starts SSO with their email address | Consentio application |
| 2 | API builds the authorization request | /v2/oidc/login |
| 3 | Browser is redirected to the IdP | Your authorization endpoint |
| 4 | User authenticates | Your IdP |
| 5 | IdP returns the authorization code | https://api.consentio.co/v2/oidc/callback/ |
| 6 | API redeems the code and validates the ID token | Your token endpoint |
| 7 | API hands a single-use code to the app | /bridge?auth-code=…&organisation-public-id=… |
| 8 | App exchanges it for tokens | POST /v2/sso/exchange-token |
What the callback validates
| Check | Behaviour |
|---|---|
state |
Signed by Consentio and matched against a stored login state, which is then consumed |
| ID token | Decrypted if it is a JWE, then verified against your IdP's published keys |
nonce |
Must equal the nonce Consentio put in the authorization request |
email |
Must be present, and must match the address entered at login |
| Account status | A deactivated user is refused at the start of the flow |
SAML flow
SAML uses SP-initiated SSO, with the AuthnRequest sent over HTTP-Redirect and the assertion returned over HTTP-POST.
SAML step by step
| Step | Action | Endpoint |
|---|---|---|
| 1 | User starts SSO with their email address | Consentio application |
| 2 | App requests a SAML login | POST /v2/saml/login |
| 3 | Browser is redirected to the IdP | Your SSO URL (HTTP-Redirect) |
| 4 | User authenticates | Your IdP |
| 5 | IdP posts the assertion | POST /v2/saml/acs/{orgId} (HTTP-POST) |
| 6 | API hands a single-use code to the app | /bridge?auth-code=…&organisation-public-id=… |
| 7 | App exchanges it for tokens | POST /v2/sso/exchange-token |
Comparing the two
| Aspect | OIDC | SAML |
|---|---|---|
| Assertion format | JWT (ID token), optionally encrypted as a JWE | Signed XML assertion |
| Return binding | HTTP-GET with an authorization code | HTTP-POST with the assertion |
| Credential exchange | Backend redeems the code at your token endpoint | Assertion posted directly to the ACS |
| Return URL | /v2/oidc/callback/ |
/v2/saml/acs/{orgId} |
| Replay protection | state, nonce and PKCE |
InResponseTo against a stored request ID |
| Single logout | Via your end_session_endpoint |
Not supported |
Both protocols share the same ending: a single-use authorization code carried through /bridge, exchanged by the application for a token pair. The code is deleted as it is redeemed, so it cannot be replayed.
Session lifetime
| Token | Lifetime | Notes |
|---|---|---|
| Access token | The configured session duration, 60 minutes on production | Self-contained; not checked against the directory on every request |
| Refresh token | 30 days | Refused once the user is deactivated or the device is disabled |
Because the access token is self-contained, a change made through SCIM — a deactivation above all — takes effect immediately for new logins and refreshes, while an access token already in the user's hands stays usable until it expires. See Deactivating a user for exactly what changes and when.
Logout flow
Signing out always ends the Consentio session on that device and invalidates its refresh tokens. If the session was established over OIDC and your discovery document publishes an end_session_endpoint, the response also carries an IdP logout URL, built with id_token_hint, client_id and a post-logout redirect back to the application login page. SAML sessions end locally only; see SAML Configuration.
Next steps
- OIDC Configuration — endpoints, claims and the security profile.
- SAML Configuration — endpoints, certificate and attribute mapping.
- SCIM Provisioning — keep accounts in step with your directory.