Two-factor authentication options for Microsoft users in Sanity
Sanity has no separate 2FA switch for an organization or project. Login security belongs to whichever identity provider the person signs in with. Users of Microsoft services have two options:
- Without SAML SSO: they sign in with Google, GitHub or email/password. They should turn on 2FA with that provider.
- With SAML SSO (Enterprise plan): they sign in through Microsoft Entra ID (formerly Azure AD), and the Entra ID sign-in policies, including any MFA, cover the login.
Standard sign-in methods
A Sanity account is created with Google, GitHub or an email address and password. Each method creates a separate account, even when the email address is the same (Manage your account).
- Google or GitHub: turn on 2FA in the Google or GitHub account. The Sanity login goes through that provider.
- Email/password with a Microsoft address: 2FA on the Outlook or Microsoft 365 mailbox protects the inbox, but it does not control how the person signs in to Sanity. The account settings docs only list editing your name, resetting your password, notifications, connected applications and deleting the account. They don't mention a 2FA setting. If the customer needs a second factor and has no SAML, have them use Google or GitHub with 2FA turned on, or ask Sanity support whether email/password accounts support 2FA.
The sign-in method can't be changed on an existing account. To switch, create a new account with the new method, have an admin remove the old account, and re-invite the new one.
Logging in with Microsoft: SAML SSO with Entra ID
With SAML SSO, users who log in through Sanity Studio or Sanity Manage are authenticated by the organization's identity provider, and Sanity assigns roles based on their groups there. It requires an organization with a project on the Enterprise plan (pricing).
Setup in short:
- In Manage, open Settings > SAML SSO for the organization and click Configure.
- Copy Sanity's entity ID and callback URL into the Entra ID enterprise application. Set the Name ID format to Persistent and send the
email,firstName,lastNameandgroupsclaims. - Enter Entra ID's login URL, issuer and certificate in Manage. Clear Enable InResponseTo, because Entra ID doesn't send it.
- Enable SSO on each project and add role mapping rules. Entra ID sends group IDs, not group names, so write the rules against the IDs.
- Add SAML login to the Studio with the snippet Manage gives you for
sanity.config.ts, either alongside the default providers or replacing them.
Full walkthrough: Set up SSO authentication with SAML and Azure/Entra ID.
Things to know:
- Studio login options apply only to that Studio. The sanity.io login screen (Manage, Dashboard, Media Library) still offers email/password, Google and GitHub, and you can't hide those options.
- Turning on SAML doesn't block existing Google, GitHub or email accounts. Check the member list and remove accounts you don't want.
- A SAML identity is a separate account. Anyone who switches takes two seats until the old account is removed.
- Removing someone in Entra ID doesn't remove them from Sanity, because Sanity doesn't support SCIM. Remove them in Sanity yourself.
In short
Tell the customer to turn on 2FA with whichever provider they sign in to Sanity with. To sign in with Microsoft identities and enforce Entra ID MFA policies, they need SAML SSO on the Enterprise plan.
Show original thread5 replies
Was this answer helpful?
Sanity – Build the way you think, not the way your CMS thinks
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.