> For the complete documentation index, see [llms.txt](https://wiki.datadike.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.datadike.com/pam/administration/identities/sso.md). Agents can also search and read this documentation through its [MCP server](https://wiki.datadike.com/~gitbook/mcp).

# Single sign-on

Delegate console login to a corporate identity provider over SAML2, OIDC, OAuth2, CAS, or Slack, and map the provider's attributes onto user records here.

## What this is and when to use it

With single sign-on, the identity provider authenticates the person and the solution trusts the assertion it gets back. Users reach the console without a separate password, and the second factor and conditional-access rules configured in the corporate provider are honoured at this login too.

Use it when the organization already runs an identity provider — Entra ID (Azure AD)/ADFS, Okta, Keycloak, PingFederate, OneLogin, Google Workspace. If what you have is a directory rather than a federation provider, see [LDAP and Active Directory](https://wiki.datadike.com/pam/administration/identities/ldap-and-ad.md) instead.

{% hint style="warning" %}
The solution acts **exclusively as a Service Provider**. It consumes assertions from an identity provider; it cannot act as an identity provider for other applications.
{% endhint %}

Methods can be enabled individually and coexist, so a migration does not have to be a cutover — leave local login and the old method enabled until the new one is proved.

Two providers have a step-by-step guide: [Microsoft Entra ID over OIDC](https://wiki.datadike.com/pam/administration/identities/sso-entra-id.md) and [Google Workspace over SAML2](https://wiki.datadike.com/pam/administration/identities/sso-google-workspace.md).

## Which method to pick

| Method     | Use it for                                                                    |
| ---------- | ----------------------------------------------------------------------------- |
| **SAML2**  | The enterprise default. Entra ID/ADFS, Okta, PingFederate, OneLogin           |
| **OIDC**   | Modern SSO on top of OAuth 2.0. Keycloak, Entra ID, Google Workspace, Okta    |
| **OAuth2** | A provider with no OIDC or SAML support, where you wire the endpoints by hand |
| **CAS**    | An existing CAS deployment. Ticket-based; version 3 is supported              |
| **Slack**  | Teams that already live in Slack. Needs a Slack App                           |

## Before you start

* The **SYSADMIN** profile.
* Administrative access to the identity provider, or someone who has it — the configuration is symmetric and both halves must be done.
* The public URL of this installation. The callback URL the provider redirects to is derived from it, and a mismatch is the usual first failure.
* For SAML2, the Service Provider certificate to upload, and the identity provider's metadata.
* For OAuth2, the authorization, token, and userinfo endpoints.
* For Slack, a Slack App with its Client ID and Client Secret.

## Steps

1. Open **System Settings › Authentication** and select the method.
2. Enable the provider. Only enabled providers appear on the login screen.
3. Enter the provider-specific configuration:
   * **SAML2** — upload the SP certificate and configure the IdP side.
   * **OIDC** — the provider details, plus the **Realm** for Keycloak and the shared-session setting.
   * **OAuth2** — the authorization, token, and userinfo endpoints, configured manually.
   * **CAS** — the CAS server, using the URLs below.
   * **Slack** — the Slack App's Client ID and Client Secret.
4. Set the **User attribute** map — the JSON that says which claim or attribute from the provider feeds `username`, `name`, and `email` here. See [Attribute mapping](#attribute-mapping).
5. Set the **Organization** that provider users are created in, if user creation is enabled. This decides which tenant they land in.
6. Register the callback URL on the provider side, exactly as the solution publishes it.
7. Save, and test in a private browser window so you do not lose your current session.

### Service URLs

Each provider exposes three endpoints under the installation's own hostname:

| Purpose                   | Path                                                   |
| ------------------------- | ------------------------------------------------------ |
| Login                     | `https://<your-server>/core/auth/<provider>/login/`    |
| Successful-login callback | `https://<your-server>/core/auth/<provider>/callback/` |
| Logout                    | `https://<your-server>/core/auth/<provider>/logout/`   |

`<provider>` is the method's own name in the URL: `openid` for OIDC, `saml2`, `cas`, `oauth2`, and so on. The callback URL is the one that has to be registered with the identity provider.

SAML2 also publishes the service provider metadata, with the Entity ID and the callback (ACS) URL that the identity provider needs, at `https://<your-server>/core/auth/saml2/metadata/`. It is available only once the SP private key and certificate have been saved.

### Attribute mapping

The map is plain JSON, and **its direction depends on the method**:

| Method              | Key                                              | Value                        |
| ------------------- | ------------------------------------------------ | ---------------------------- |
| OIDC, OAuth2, Slack | The user field here: `username`, `name`, `email` | The claim the provider sends |
| SAML2, CAS          | The attribute the provider sends                 | The user field here          |

For SAML2, only `username`, `name`, `email`, `comment`, `phone`, and `groups` are read; any other attribute is ignored.

CAS publishes prefixed attribute names:

```json
{
  "cas:user": "username",
  "cas:fullname": "name",
  "cas:mail": "email"
}
```

An OAuth2 provider that exposes a scoped email claim:

```json
{
  "name": "user",
  "username": "name",
  "email": "user:email"
}
```

Take the attribute names from the provider's own documentation or from a test assertion. Guessing produces a successful login and a user record with blank fields.

### Accept only users who already exist

By default, someone who signs in through an external method for the first time gets a user record created automatically. To accept only people already registered here, by hand or synchronized from LDAP, open **System settings › Security › Login restriction** and turn on **Existing users only**. The setting covers every external method at once.

## What you should see

The login screen gains a button for the provider. Local login stays available unless you disable it.

## How to verify it worked

1. In a private browser window, open the console and choose the provider. You should be redirected to the identity provider, authenticate there, and return signed in.
2. Open **Users › Users** and find the user. The **Source** column must show the external provider rather than `Local` — otherwise you signed in against a pre-existing local account and have tested nothing.
3. Check **Name** and **Email** on that record. Blank fields mean the attribute map is wrong even though the login worked.
4. Confirm the user landed in the intended organization.
5. Check the sign-in is recorded in the audit trail with the provider as the authentication source. See [Audit trail](https://wiki.datadike.com/pam/administration/audit/audit-trail.md).
6. Sign out and confirm you are not silently signed straight back in — the logout URL is part of the configuration for a reason.

## Common errors

| Symptom                                          | Cause                                                                   | Fix                                                                                     |
| ------------------------------------------------ | ----------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| The provider is missing from the login screen    | It is configured but not enabled                                        | Tick the provider's enable checkbox                                                     |
| The identity provider refuses the redirect       | The callback URL registered there does not match the one published here | Register the exact `/core/auth/<provider>/callback/` URL, including scheme and hostname |
| Login succeeds but the user has no name or email | The **User attribute** map names claims the provider does not send      | Correct the JSON against a real assertion from the provider                             |
| Users appear in the wrong tenant                 | **Organization** on the provider is not the one you expected            | Set it before the first sign-in; moving users afterwards is manual                      |
| You are locked out mid-configuration             | The only enabled method is the one being changed                        | Keep local login enabled until SSO is proved, and test in a private window              |
| Sign-out returns you straight to the console     | The provider's session is still open                                    | Configure the logout URL so the session is ended at the provider too                    |

## Field reference

Fields common to every provider:

| Field          | What it means                                                               |
| -------------- | --------------------------------------------------------------------------- |
| Enable         | Per-provider checkbox. Only enabled providers appear on the login screen    |
| User attribute | JSON map from the provider's attributes to `username`, `name`, and `email`  |
| Organization   | The tenant that provider users are created in when user creation is enabled |

Provider-specific configuration documented for each method:

| Method | Configuration                                                          |
| ------ | ---------------------------------------------------------------------- |
| SAML2  | Upload of the Service Provider certificate, plus the IdP configuration |
| OIDC   | Provider details, **Realm** (for Keycloak), and shared-session control |
| OAuth2 | Authorization, token, and userinfo endpoints, entered manually         |
| CAS    | CAS server, with login, callback, and logout URLs. Supports version 3  |
| Slack  | A Slack App's Client ID and Client Secret                              |

## Related pages

* [LDAP and Active Directory](https://wiki.datadike.com/pam/administration/identities/ldap-and-ad.md) — directory login and user sync
* [Multi-factor authentication](https://wiki.datadike.com/pam/administration/identities/mfa.md) — a second factor here, or delegated to the identity provider
* [Users and groups](https://wiki.datadike.com/pam/administration/identities/users-and-groups.md) — the records SSO creates
* [Login policies](https://wiki.datadike.com/pam/administration/access/login-policies.md) — when and from where sign-in is allowed
* [Roles and permissions](https://wiki.datadike.com/pam/administration/identities/roles.md) — what a user may do once inside
