Gamma API
AuthenticationSingle sign-on

Register an identity provider

POST
/api/auth/sso/register

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

Authorization

session
cookiegamma.session_token<token>

The session cookie a sign-in sets. Over HTTPS its name carries the __Secure- prefix. Browsers send it on their own; other clients keep it from the sign-in response.

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 'http://localhost:3000/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"}