Skip to Content
Documentation

Enterprise SSO

OIDC and SAML 2.0 sign-in per organization.

GET
/sso/saml2/sp/metadata

Returns the SAML metadata for the Service Provider

Query Parameters

providerId?string

Response Body

SAML metadata in XML format

Example Request
curl -X GET 'https://auth.example.com/api/auth/sso/saml2/sp/metadata'
Example Response
Empty

Register SSO Provider

POST
/sso/register

This endpoint is used to register an OIDC provider. This is used to configure the provider and link it to an organization

Request Body

application/json
  1. body
providerId*string

The ID of the provider. This is used to identify the provider during login and callback

issuer*string

The issuer URL of the provider

domain*string

The domain(s) of the provider. For enterprise multi-domain SSO where a single IdP serves multiple email domains, use comma-separated values (e.g., 'company.com,subsidiary.com,acquired-company.com')

oidcConfig?
samlConfig?
organizationId?string

If organization plugin is enabled, the organization id to link the provider to

overrideUserInfo?boolean

Override user info with the provider info. Defaults to false

Response Body

OIDC provider created successfully

application/json
  1. response
issuer*string

The issuer URL of the provider

Formaturi
domain*string

The domain of the provider, used for email matching

domainVerified?boolean

A boolean indicating whether the domain has been verified or not

domainVerificationToken?string

Domain verification token. It can be used to prove ownership over the SSO domain

oidcConfig*

OIDC configuration for the provider

organizationId?string

ID of the linked organization, if any

userId*string

ID of the user who registered the provider

providerId*string

Unique identifier for the provider

redirectURI*string

The redirect URI for the provider callback

Formaturi
Example Request
curl -X POST 'https://auth.example.com/api/auth/sso/register' \  -H 'Content-Type: application/json' \  -d '{  "providerId": "string",  "issuer": "string",  "domain": "string"}'
Example Response
{  "issuer": "http://example.com",  "domain": "string",  "domainVerified": true,  "domainVerificationToken": "string",  "oidcConfig": {    "issuer": "http://example.com",    "pkce": true,    "clientId": "string",    "clientSecret": "string",    "authorizationEndpoint": "http://example.com",    "discoveryEndpoint": "http://example.com",    "userInfoEndpoint": "http://example.com",    "scopes": [      "string"    ],    "tokenEndpoint": "http://example.com",    "tokenEndpointAuthentication": "client_secret_post",    "jwksEndpoint": "http://example.com",    "mapping": {      "email": "string",      "emailVerified": "string",      "name": "string",      "image": "string",      "extraFields": {        "property1": "string",        "property2": "string"      }    }  },  "organizationId": "string",  "userId": "string",  "providerId": "string",  "redirectURI": "http://example.com"}

Sign In With SSO

POST
/sign-in/sso

This endpoint is used to sign in with an SSO provider. It redirects to the provider's authorization URL

Request Body

application/json
  1. body
email?string

The email address to sign in with. Used to resolve the provider via the email domain; optional if providerId, domain, or organizationSlug is provided.

organizationSlug?string

The slug of the organization to sign in with.

providerId?string

The ID of the provider to sign in with. Can be provided instead of email.

domain?string

The email domain of the provider. Can be provided instead of email.

callbackURL*string

The URL to redirect to after successful sign-in.

errorCallbackURL?string

The URL to redirect to if the sign-in flow fails.

newUserCallbackURL?string

The URL to redirect to after sign-in if the user is newly registered.

scopes?array<string>

Scopes to request from the provider.

loginHint?string

Login hint to send to the identity provider (e.g., email or identifier). If supported, sent as 'login_hint'.

additionalParams?

Extra query parameters to append to the OIDC provider authorization URL. RFC 6749 reserved keys (state, client_id, redirect_uri, response_type, code_challenge, code_challenge_method, scope) are rejected. Not supported for SAML providers.

requestSignUp?boolean

Explicitly request sign-up. Useful when disableImplicitSignUp is true for this provider.

providerType?string

The provider protocol to sign in with.

Value in"oidc""saml"

Response Body

Authorization URL generated successfully for SSO sign-in

application/json
  1. response
url*string

The authorization URL to redirect the user to for SSO sign-in

Formaturi
redirect*true

Indicates that the client should redirect to the provided URL

Value intrue
Example Request
curl -X POST 'https://auth.example.com/api/auth/sign-in/sso' \  -H 'Content-Type: application/json' \  -d '{  "callbackURL": "string"}'
Example Response
{  "url": "http://example.com",  "redirect": true}

Handle SSO Callback

GET
/sso/callback/{providerId}

This endpoint is used as the callback URL for SSO providers. It handles the authorization code and exchanges it for an access token

Path Parameters

providerId*string

Query Parameters

code?string
state?string
error?string
error_description?string

Response Body

Redirects to the callback URL

Example Request
curl -X GET 'https://auth.example.com/api/auth/sso/callback/string'
Example Response
Empty
GET
/sso/saml2/sp/acs/{providerId}

Handles SAML responses from IdP after successful authentication. Supports GET for post-auth redirects and POST for SAML response processing.

Path Parameters

providerId*string

Query Parameters

RelayState?string

Response Body

Redirects after authentication (success or error with query params)

Example Request
curl -X GET 'https://auth.example.com/api/auth/sso/saml2/sp/acs/string'
Example Response
Empty
POST
/sso/saml2/sp/acs/{providerId}

Handles SAML responses from IdP after successful authentication. Supports GET for post-auth redirects and POST for SAML response processing.

Path Parameters

providerId*string

Query Parameters

RelayState?string

Request Body

application/json
  1. body
SAMLResponse*string
RelayState?string

Response Body

Redirects after authentication (success or error with query params)

Example Request
curl -X POST 'https://auth.example.com/api/auth/sso/saml2/sp/acs/string' \  -H 'Content-Type: application/json' \  -d '{  "SAMLResponse": "string"}'
Example Response
Empty
GET
/sso/saml2/sp/slo/{providerId}

Path Parameters

providerId*string

Query Parameters

SAMLRequest?string
SAMLResponse?string
RelayState?string
SigAlg?string
Signature?string

Response Body

Bad Request. Usually due to missing parameters, or invalid parameters.

application/json
  1. response
message*string
Example Request
curl -X GET 'https://auth.example.com/api/auth/sso/saml2/sp/slo/string'
Example Response
{  "message": "string"}
POST
/sso/saml2/sp/slo/{providerId}

Path Parameters

providerId*string

Query Parameters

SAMLRequest?string
SAMLResponse?string
RelayState?string
SigAlg?string
Signature?string

Request Body

application/json
  1. body
SAMLRequest?string
SAMLResponse?string
RelayState?string
SigAlg?string
Signature?string

Response Body

Bad Request. Usually due to missing parameters, or invalid parameters.

application/json
  1. response
message*string
Example Request
curl -X POST 'https://auth.example.com/api/auth/sso/saml2/sp/slo/string' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "message": "string"}
POST
/sso/saml2/logout/{providerId}

Path Parameters

providerId*string

Request Body

application/json
  1. body
callbackURL?string

Response Body

Bad Request. Usually due to missing parameters, or invalid parameters.

application/json
  1. response
message*string
Example Request
curl -X POST 'https://auth.example.com/api/auth/sso/saml2/logout/string' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "message": "string"}