Auth API
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 root config key auth
for the studio or workspace, by using the helper function createAuthStore
. Additional details and configurations can be found in the documentation on Migrating Custom Auth Providers.
import {createAuthStore, defineConfig} from 'sanity'
export default defineConfig({
..., // The rest of the other studio config.
auth: createAuthStore({
projectId: 'dsf3cqw',
dataset: 'production',
mode: 'replace',
redirectOnSingle: false,
providers: [
{
name: 'enterprise-sso',
title: 'My Enterprise SSO',
url: 'https://my-enterprise.com/login',
},
],
}),
})
REQUIREDprojectIdstring
The ID for your project
REQUIREDdatasetstring
The name of your dataset
modestring
Value should be either
append
orreplace
. Append the custom providers (listed inproviders
) to the default providers or replace them.redirectOnSingleboolean
If true, don't show the choose provider logo screen – automatically redirect to the single provider login.