> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/documentation/use-octoxlabs/settings/third-party-services-settings/sso-settings.md).

# SSO Settings

Enable single sign-on with Google Workspace, Microsoft Entra ID or MonoSign so users sign in with their identity provider account.

**SSO Settings** adds a **Sign in with** button to the sign-in page for each identity provider you enable. A user who clicks it signs in at the provider and returns to OctoXLabs already signed in, with no OctoXLabs password.

OctoXLabs ships with three providers. All three use the OAuth 2.0 authorization code flow:

| Provider           | Console name           | What OctoXLabs reads from the provider                                                     |
| ------------------ | ---------------------- | ------------------------------------------------------------------------------------------ |
| Google Workspace   | **Google Workspace**   | Email, given name and family name (scopes `openid email profile`).                         |
| Microsoft Entra ID | **Microsoft Entra ID** | The `mail`, `givenName` and `surname` attributes from Microsoft Graph (scope `User.Read`). |
| MonoSign           | **MonoSign**           | Email and profile names from the access token (scope `profile`).                           |

You can only configure these providers. You cannot add a new provider, and the console has no SAML or generic OIDC option.

### Before you begin

* Required permission to open the page: `sso.view_ssoprovider`. Permissions of the `sso` app, like those of LDAP, SMTP and Syslog, can be held only by administrators. They cannot be added to a custom group.
* An application registered at the provider, with the redirect URI described below. You need its **Client ID** and **Client Secret**. For Entra you also need the **Tenant ID**. For MonoSign you need the **Base API URL** of your MonoSign server.
* The OctoXLabs server must be able to reach the provider over HTTPS to exchange the sign-in code. If your network inspects TLS with an internal CA, see Add an SSL Certificate.

### Configure a provider

{% stepper %}
{% step %}

#### Register OctoXLabs at the provider

Create an OAuth application (in Entra, an app registration) at your identity provider. Use `https://your-octo-host/external-sso/google`, `https://your-octo-host/external-sso/entra` or `https://your-octo-host/external-sso/monosign` as the redirect URI, matching the provider. These are the callback pages of the console. Copy the client ID and secret.
{% endstep %}

{% step %}

#### Open the page

Go to **Settings** > **3rd Party Services Settings** > **SSO Settings**. Pick the provider tab.
{% endstep %}

{% step %}

#### Fill in the options

Enter the options from the table below. **Redirect URI** must be exactly the value you registered.
{% endstep %}

{% step %}

#### Enable and save

Select **Enabled** and save the form. The console shows **SSO Settings saved**. A provider appears on the sign-in page only while it is enabled.
{% endstep %}
{% endstepper %}

IMAGEHERE: SSO Settings page with the Microsoft Entra ID tab selected.

### Settings

Every tab has **Enabled** plus its own options. All options are required.

| Setting           | Type     | Default | Providers          | Description                                                                                                                   |
| ----------------- | -------- | ------- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------- |
| **Enabled**       | Checkbox | Off     | All                | Shows the provider on the sign-in page.                                                                                       |
| **Client ID**     | Text     | Empty   | All                | Application (client) ID from the provider.                                                                                    |
| **Client Secret** | Password | Empty   | All                | Client secret. It is stored encrypted and shown as ten asterisks after saving. Leave the asterisks to keep the stored secret. |
| **Redirect URI**  | URL      | Empty   | All                | Callback address registered at the provider.                                                                                  |
| **Tenant ID**     | Text     | Empty   | Microsoft Entra ID | Directory (tenant) ID of your Entra tenant.                                                                                   |
| **Base API URL**  | Text     | Empty   | MonoSign           | Base address of your MonoSign server.                                                                                         |

### How users are matched

After the provider confirms the user, OctoXLabs looks for a user with the same email address.

* If one exists, that user signs in.
* If none exists, OctoXLabs creates an active user. The username is the part of the email before the `@`, in lower case, and the first and last name come from the provider.

OctoXLabs does not assign any group to a user it creates, so the user can sign in but has no permissions yet. Add the user to a group in Users. SSO sign-in goes straight to a session. OctoXLabs does not ask for its own two-factor code afterwards.

Sign-in events are recorded in the User Activities log as **SSO login successful**, **SSO account created** and **SSO login unsuccessful**. A failed attempt includes the provider name.

### Verify the result

Open the sign-in page in a private window. The provider must appear under **or with SSO**. Click it, sign in at the provider, and check that you land in the console. Then open the user activity log and look for **SSO login successful**.

### Troubleshooting

| Symptom or error message                                                   | Cause                                                                                                                                                                                | Fix                                                                                                                                                                                                                                           |
| -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| The provider button is missing from the sign-in page                       | The provider is not **Enabled**, or the page was loaded before you saved.                                                                                                            | Select **Enabled**, save, and reload the sign-in page.                                                                                                                                                                                        |
| The sign-in page opens by domain name but `/sso/sso/providers` returns 404 | The domain was not added to a company, so no providers can be listed.                                                                                                                | See Custom Domains.                                                                                                                                                                                                                           |
| `Failed to obtain authorization URL.`                                      | The provider options are incomplete or invalid, so OctoXLabs cannot build the sign-in address.                                                                                       | Check that every option on the tab has a value, then try again.                                                                                                                                                                               |
| `Failed to authenticate.` and you return to the sign-in page               | The sign-in code or `state` was invalid or older than 5 minutes, the secret or **Redirect URI** is wrong, the provider refused the token request, or the provider returned no email. | Try again and finish within 5 minutes. Compare **Client ID**, **Client Secret** and **Redirect URI** with the provider. For Entra, make sure the account has a `mail` attribute. Check the backend log named `sso` for the provider's answer. |
| The provider shows a redirect URI mismatch                                 | **Redirect URI** differs from the one registered at the provider.                                                                                                                    | Make both values identical, including `https` and the path.                                                                                                                                                                                   |
| Sign-in works but the user sees no data or permission denied               | OctoXLabs created the user without a group.                                                                                                                                          | Add the user to a group in Users.                                                                                                                                                                                                             |
| `Creation of SSO providers is not allowed via the API.`                    | You tried to add a provider through the API.                                                                                                                                         | Only the built-in providers can be configured.                                                                                                                                                                                                |

### What's next?

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Users</strong></td><td>Manage users created by SSO.</td><td></td></tr><tr><td><strong>Groups</strong></td><td>Give SSO users their permissions.</td><td></td></tr><tr><td><strong>LDAP</strong></td><td>Sign in with directory accounts.</td><td></td></tr><tr><td><strong>Custom Domains</strong></td><td>Serve OctoXLabs on your own domain.</td><td></td></tr></tbody></table>
