Studio customization
Structure builder
Was this page helpful?
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. This is done by configuring the config key auth for the studio or workspace with a configuration object that adheres to the AuthConfig signature.
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',
},
],
},
})import {defineConfig} from 'sanity'
export default defineConfig({
// ... The rest of the studio config.
auth: {
providers: (prev) => [...prev,
{
name: 'newProvider',
title: 'Email / Password',
url: 'https://url.to.other.login',
}
]
},
})In studio versions prior to v3.15.0 the recommended way to configure custom authentication included using the createAuthConfig helper method. This approach will still work, but is considered deprecated in favor of the more straight forward new method.
This feature is available as an addon for the Growth plan.
When you configure SSO with SAML, you're receive a code snippet to help you configure the custom authentication section if your Sanity config.
This article will take you through the process of setting up SAML (Security Assertion Markup Language) SSO (Single Sign-on) for your organization.
Implement single-sign on for Sanity with JumpCloud
Implement single-sign on for Sanity with PingIdentity SAML
Implement single sign-on authentication with the SAML protocol and Microsoft Azure AD/ Entra ID as the identity provider.
If you use a self-hosted Studio and use SSO, you may run into issues accessing Media Library.
To work around this, use one of the following options:
auth.loginMethod: 'token'.We're working to support other methods in the future.
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',
},
],
},
})import {defineConfig} from 'sanity'
export default defineConfig({
// ... The rest of the studio config.
auth: {
providers: (prev) => [...prev,
{
name: 'newProvider',
title: 'Email / Password',
url: 'https://url.to.other.login',
}
]
},
})