Microsoft#
Lets people sign in with a Microsoft work or school account (Microsoft Entra ID), or a personal Microsoft account. Last checked against Microsoft's documentation on 30 October 2026.
Set it up#
Run
leptoskit auth provider add microsoft. It adds:[auth.providers.microsoft] client_id_env = "MICROSOFT_CLIENT_ID" client_secret_env = "MICROSOFT_CLIENT_SECRET" tenant = "common"In the Microsoft Entra admin center, under App registrations, create a registration with a "Web" redirect URI of
https://myapp.com/auth/callback/microsoft, andhttp://localhost:3000/auth/callback/microsoftfor development.Under Certificates & secrets, create a client secret.
Set
MICROSOFT_CLIENT_ID(the application ID) andMICROSOFT_CLIENT_SECRET.Choose
tenant:commonfor any account,organizationsfor work and school accounts only,consumersfor personal accounts only, or your tenant's ID for your own organization only.Turn on the
auth-providersfeature, and runleptoskit auth doctor.
What sign-in gets#
A stable ID for the person and their name. The ID token's issuer must be the person's own tenant, and the tenant must be one tenant allows.
Microsoft's email claim is never trusted: an organization's administrator can set it to any address, which has been used to take over accounts in apps that matched on it. leptoskit keeps it on the connected account for display, but never stores it as a verified address or uses it to find another account.
Platforms#
It works on the web, and in iOS, macOS, and Android apps through the system browser, with the same redirect URIs: the browser comes back to your site, which sends it on to the app. See Sign-in for each platform.