> For AI agents: the complete Sanity documentation index is available at [https://www.sanity.io/docs/llms.txt](https://www.sanity.io/docs/llms.txt).

# Custom authentication

The Studio can be configured to use your own login solution rather than the standard ones by supplying the auth provider details in your studio configuration.

Custom authentication can be configured for the Studio or individual workspaces. Set the `auth` config key with a configuration object that adheres to the [AuthConfig](https://reference.sanity.io/sanity/index/AuthConfig/) signature.

> [!WARNING]
> Studio v6 behavior change
> Changed in Studio v6: Passing a plain array to `auth.providers` now replaces all default providers. The `mode: 'append'` option has been removed. To keep existing providers and add new ones, use the callback form shown in the "Append to existing providers" tab below.

**Limit providers**

```typescript
import {defineConfig} from 'sanity'

export default defineConfig({
  // ... The rest of the studio config.
  auth: {
    providers: [
      {
        name: 'sanity',
        title: 'Email / Password',
        url: 'https://api.sanity.io/v1/auth/login/sanity',
      },
    ],
  },
})
```

**Append to existing providers**

```typescript
import {defineConfig} from 'sanity'

export default defineConfig({
  // ... The rest of the studio config.
  auth: {
    providers: (prev) => [...prev,
      {
        name: 'newProvider',
        title: 'My Company SSO',
        url: 'https://url.to.other.login',
      }
    ]
  },
})
```

> [!WARNING]
> Gotcha
> In Studio versions prior to v3.15.0, the recommended way to configure custom authentication included using the `createAuthStore` helper method. This approach still works, but is deprecated and will be removed in Studio v7. Remove the function call and pass its arguments to the `auth` config key instead.

## SAML single sign-on (SSO)

**This is a paid feature**
This feature is available on certain Enterprise plans. [Talk to sales](https://www.sanity.io/contact/sales?ref=docs) to learn more.

When you configure SSO with SAML, you receive a code snippet to help you configure the custom authentication section of your Sanity config.

#### SAML and SSO guides

[Set up single sign-on with SAML](https://www.sanity.io/docs/developer-guides/sso-saml)
This article takes you through the process of setting up SAML (Security Assertion Markup Language) SSO (single sign-on) for your organization.

[Set up SSO authentication with SAML and JumpCloud](https://www.sanity.io/docs/developer-guides/set-up-sso-authentication-with-saml-and-jumpcloud)
Implement single sign-on for Sanity with JumpCloud

[Set up SSO authentication with SAML and Ping Identity](https://www.sanity.io/docs/developer-guides/set-up-sso-authentication-with-saml-and-pingidentity)
Implement single sign-on for Sanity with Ping Identity SAML

[Set up SSO authentication with SAML and Azure/Entra ID](https://www.sanity.io/docs/developer-guides/set-up-sso-authentication-with-saml-and-azure)
Implement single sign-on authentication with the SAML protocol and Microsoft Entra ID (formerly Azure AD) as the identity provider.

## SSO and Media Library

If you use a self-hosted Studio with SSO, you may run into issues accessing Media Library.

To work around this, use one of the following options:

- Use a token-based login method by setting `auth.loginMethod: 'token'`, if your provider supports it.
- Log in to the [Dashboard](https://www.sanity.io/docs/dashboard/dashboard-introduction) prior to accessing Media Library.

We're working to support other methods in the future.



## Related changelog entries

Entries are listed newest first; each link points to the full entry as markdown. Follow one when you need to know what changed, when, or why — for example, to summarize recent updates, explain behavior that differs from older documentation, or check whether a fix has shipped.

- [Sanity Studio v6.16.0: Unknown Portable Text values no longer crash the editor, plus auth, release, and presence fixes](https://www.sanity.io/docs/changelog/studio-Ni4xNS4w.md) — September 22, 2026
- [Sanity Studio v5.31.0: Improve mobile presentation tabs, annotation popovers, and auth layouts](https://www.sanity.io/docs/changelog/studio-NS4zMC4w.md) — June 10, 2026
- [Sanity Studio v3.15.0: Improvements and bugfixes](https://www.sanity.io/docs/changelog/aaf2052f-80a1-4fa3-877f-6a9f7518c894.md) — August 8, 2023