---
title: "Authentication: SSO Certificates and Users"
description: "Register an SSO server certificate and SSO user entries in RavenDB, and keep SSO authentication working across certificate renewals by reusing the same key."
url: "https://docs.ravendb.net/7.2/server/security/authentication/sso-certificates"
version: "7.2"
---

# Authentication: SSO Certificates and Users

> RavenDB publishes an official agent skill for coding assistants at https://docs.ravendb.net/skills/ravendb/SKILL.md (also installable with `npx skills add ravendb/skills`). The skill describes itself as: "Read this before writing any RavenDB query, client call or /databases/ request. Covers server setup, document modelling, the Node.js, .NET and Python clients, RQL, indexes, vector search and AI agents. Code written from recall tends to run and return the wrong rows, because RQL resembles SQL and the clients take field names as plain strings."

## Authentication: SSO Certificates and Users

> **Note**
>
> - RavenDB can authenticate users who arrive through an [SSO reverse-proxy application](https://docs.ravendb.net/7.2/server/security/sso/overview.md) - GitHub, Google,
>   Microsoft/Entra ID, or Windows/Kerberos - instead of issuing one X.509 client certificate per user.
>
> - The cluster needs to know two things to do this:
>   - **Which SSO servers to trust** - registered as certificates with `Usage = SsoServer`.
>   - **How to map an SSO identity to RavenDB permissions** - stored as **SSO user entries** with `Usage = SsoClient`.
>
> - Both are managed from `Manage Server` > `User Access Management` in Studio, and live in the same certificate list as your regular server and client certificates.
>
> - For end-to-end deployment of the SSO application itself, see the [SSO Overview](https://docs.ravendb.net/7.2/server/security/sso/overview.md).  
>   This page focuses on the certificate-management side of the workflow.
>
> - In this article:
>   - [Required clearance and license](#required-clearance-and-license)
>   - [Register an SSO server certificate](#register-an-sso-server-certificate)
>     - [Studio](#studio)
>     - [HTTP API](#http-api)
>   - [Register an SSO user entry](#register-an-sso-user-entry)
>     - [Studio](#studio-1)
>     - [HTTP API](#http-api-1)
>   - [Renewing the SSO server certificate](#renewing-the-sso-server-certificate)
>   - [Supported providers](#supported-providers)
>   - [Related reading](#related-reading)

## Required clearance and license {#required-clearance-and-license}

SSO is a commercial feature gated by the RavenDB license. Registering an SSO server certificate
requires **Cluster Admin** clearance; SSO user entries can be managed by **Operator** clearance and above.

> **Warning:** License required
>
> Registering an SSO server certificate or creating an SSO user entry fails with a license error
> if your license does not permit SSO.

## Register an SSO server certificate {#register-an-sso-server-certificate}

The SSO server presents its public certificate to clients on `https://<sso-domain>`. Registering the
certificate in RavenDB tells the cluster "trust SSO identities forwarded by this server." Identification
is by **[public-key pinning hash](https://docs.ravendb.net/7.2/server/security/authentication/certificate-renewal-and-rotation.md#implicit-trust-by-public-key-pinning-hash)**, not by the certificate file itself.

### Studio

To register SSO server certificates and create SSO user entries, open:
`Manage Server` > `User Access Management`

![Manage user access menu](https://docs.ravendb.net/assets/images/sso-user-access-management-nav-dac658af17b0d51a0fd6ebf59f9f3709.png)

1. **Manage Server**  
   Click to open the Manage Server menu.
2. **User Access Management**  
   Click to open this page, where you manage SSO server certificates and SSO user entries, alongside
   the cluster's regular server and client certificates.
3. **Manage user access**  
   Click to open this dropdown. The SSO actions are:

   - [**Upload SSO certificate**](#upload-sso-certificate)  
     Register an SSO server certificate.
   - [**Generate SSO user**](#generate-sso-user)  
     Create an SSO user entry.

---

#### Upload SSO certificate

Click **Upload SSO certificate** to open the **Register SSO server certificate** dialog:

![Register SSO server certificate dialog](https://docs.ravendb.net/assets/images/register-sso-server-modal-8197a866ab531413ae4f6ccf5145707f.png)

- **Name**  
  A display name for the certificate.
- **SSO server URL**  
  Enter the SSO server's address and click **Fetch**. RavenDB downloads the public certificate from
  `https://<sso-url>/api/certificate`, validates it, and shows the parsed details.
- **Or upload certificate file**  
  Browse to a PEM or PFX file to provide the certificate yourself instead.
- **Register certificate**  
  Saves the certificate as a trusted SSO server.

---

Once registered, the SSO server certificate appears under a dedicated **SSO** section of the certificates
list, alongside any existing SSO user entries:

![Certificates list with SSO entries](https://docs.ravendb.net/assets/images/certificates-list-05443100b5535b7b698bb245577f0313.png)

### HTTP API

Every action in the Studio dialog above maps to a REST endpoint you can call directly.  
Use these endpoints to automate SSO setup as part of a deployment pipeline, instead of registering
each certificate and user by hand in Studio.

```http
PUT /admin/certificates
Content-Type: application/json

{
  "Name": "production-sso",
  "Certificate": "<base64-encoded certificate>",
  "Usage": "SsoServer",
  "SecurityClearance": "ValidUser",
  "Permissions": {}
}
```

To let the cluster fetch the certificate for you:

```http
GET /admin/certificates/sso/server/fetch?url=https://sso.example.com
```

This downloads `https://sso.example.com/api/certificate`, validates it, and returns the base64 bytes -
hand them to `PUT /admin/certificates` above. The fetch is limited to **64 KB** and times out after
**10 seconds**.

---

> **Note**
>
> SSO server certificates cannot be generated by RavenDB - they belong to the SSO deployment and must be
> imported. `POST /admin/certificates` with `Usage = SsoServer` is rejected.

## Register an SSO user entry {#register-an-sso-user-entry}

An SSO user entry is a mapping from one or more **SSO identities** to a RavenDB [security clearance](https://docs.ravendb.net/7.2/server/security/authorization/security-clearance-and-permissions.md) and
database permissions. Each identity is a `(Provider, Domain, Identifier)` tuple:

| Field | Type | Example |
| - | - | - |
| `Provider` | `Github` \| `Google` \| `Microsoft` \| `Windows` | `Windows` |
| `Domain` | string | Kerberos realm - only used when `Provider = Windows`; leave empty otherwise. |
| `Identifier` | string | `alice@example.com`, GitHub username, etc. |

Each entry must trust the SSO servers it accepts identities from. You can either:

- list one or more `SsoServerPublicKeyPinningHashes` from registered SSO servers, **or**
- set `AllowAnySsoServer = true` to accept the identity from any SSO server registered in the cluster.

Listing multiple pinning hashes is how you give one user access through several SSO deployments
(production + staging, for example) without duplicating the entry.

> **Warning:** SSO logins bypass two-factor authentication
>
> RavenDB's two-factor authentication does not apply to an SSO login. RavenDB cannot enforce a second
> factor on the identity provider's side, so multi-factor enforcement is the SSO provider's
> responsibility.  
> SSO users granted Operator or Cluster Admin clearance therefore sign in with no RavenDB-side
> second factor, so configure your identity provider to require multi-factor authentication for
> those users.

### Studio

SSO user entries are created and managed in the `Manage Server` > `User Access Management`
view.

---

#### Generate SSO user

Click **Generate SSO user** to open the **Add SSO user** dialog:

![Add SSO user dialog](https://docs.ravendb.net/assets/images/register-sso-user-modal-c2a415b4abfb90f5d001e886aeca2ce4.png)

- **Display name**  
  A display name for the user entry.
- **Identifiers**  
  Choose the provider and enter the identifier (a username or email).  
  For **Windows**, a **Domain** field appears for the Kerberos realm.  
  Click **Add** to map more than one identity to this entry.
- **Security clearance**  
  The clearance to grant: Cluster Admin, Operator, or User.
- **Authorizing SSO**  
  Turn on **Allow any SSO to authorize** to accept this identity from any registered SSO server, or
  leave it off and select the specific SSO servers this user is bound to.
- **Database permissions**  
  The per-database access to grant.
- **Add user**  
  Saves the SSO user entry.

### HTTP API

The matching endpoint for an SSO user entry:

```http
PUT /admin/certificates/sso/user
Content-Type: application/json

{
  "Name": "alice",
  "Usage": "SsoClient",
  "SsoIdentifiers": [
    { "Provider": "Google", "Domain": "", "Identifier": "alice@example.com" }
  ],
  "SsoServerPublicKeyPinningHashes": ["<pinning-hash-of-registered-sso-server>"],
  "AllowAnySsoServer": false,
  "SecurityClearance": "ValidUser",
  "Permissions": { "Northwind": "ReadWrite" }
}
```

Validation rules enforced by the endpoint:

- `Name` and at least one entry in `SsoIdentifiers` are required.
- Either `AllowAnySsoServer = true` **or** at least one pinning hash.
- Every pinning hash must reference a previously registered SSO server. Otherwise the request fails with
  a message pointing you back to the SSO server registration step.
- Each `(Provider, Domain, Identifier)` tuple is **unique cluster-wide** - edit the existing entry instead
  of creating a second one for the same identity.

## Renewing the SSO server certificate {#renewing-the-sso-server-certificate}

RavenDB identifies trusted SSO servers by their **public key pinning hash**, not by the
certificate file.  
Every SSO user entry that doesn't have `AllowAnySsoServer = true` is pinned to one or more
specific hashes.  
Public-key pinning is the same mechanism RavenDB uses for [implicit trust between server and client certificates](https://docs.ravendb.net/7.2/server/security/authentication/certificate-renewal-and-rotation.md#implicit-trust-by-public-key-pinning-hash).

> **Warning:** Renew with the same private key
>
> **If you renew the SSO server certificate with a new key pair, the hash changes and every
> non-`AllowAnySsoServer` entry stops accepting logins through that server until you re-register the new
> certificate and update each user entry's pinning list.**
>
> To keep SSO authentication working continuously across renewals, always renew the SSO server certificate
> with **the same private key** (the same Certificate Signing Request). The public key - and therefore the
> pinning hash - stays identical, and every existing SSO user entry keeps working without any change in
> RavenDB.

---

Practical guidance:

- **Let's Encrypt via the bundled SSO `certbot`** - already pins `--key-type rsa` and `--reuse-key`,
  so renewals automatically keep the public key stable. No action is needed on the RavenDB side.
- **Manually managed certificates** - when generating a renewal, re-use the existing CSR or private key
  rather than creating a fresh key pair. Most ACME clients and CAs accept a CSR-based renewal explicitly
  for this reason.
- **If you must rotate the key** - register the new SSO server certificate as a second `SsoServer` entry
  before retiring the old one. Update every SSO user entry to include the new pinning hash alongside the
  old one. Once all clients are on the new certificate, you can remove the old `SsoServer` entry and the
  old hash from the user entries.

## Supported providers {#supported-providers}

SSO recognizes four identity providers:

| `SsoProvider` | Typical `Identifier` | When to set `Domain` |
| - | - | - |
| `Github` | GitHub username | Not used - leave empty. |
| `Google` | Email address | Not used - leave empty. |
| `Microsoft` | Email or object id | Not used - leave empty. |
| `Windows` | `user@DOMAIN` | **Required** - set to the Kerberos realm. |

`Domain` is only consulted when `Provider = Windows`. For the OAuth providers it is ignored - leave it
empty (or omit it from the JSON payload).

## Related reading {#related-reading}

- [SSO Overview](https://docs.ravendb.net/7.2/server/security/sso/overview.md) - what the SSO application does and how the auth flow works.
- [Deploying the SSO application](https://docs.ravendb.net/7.2/server/security/sso/deploying-sso-app.md) - installer and Docker Compose setup.
- [Certificate Renewal & Rotation](https://docs.ravendb.net/7.2/server/security/authentication/certificate-renewal-and-rotation.md#implicit-trust-by-public-key-pinning-hash) - the public-key pinning hash mechanism that underpins SSO server trust.
