Azure AD OAuth with PKCE and multi-tenant support.
Supports tenants: common, organizations, consumers, or a specific tenant ID. PKCE (S256) is enabled by default.
# .env.local
AUTH_SECRET=your-secret-key-min-32-chars-long
MS_CLIENT_ID=your-azure-client-id
MS_CLIENT_SECRET=your-azure-client-secret
MS_REDIRECT_URI=http://localhost:3000/api/auth/callback/microsoftDefault tenant (common)
import { microsoft } from '@warpy-auth-sdk/core';
const provider = microsoft({
clientId: process.env.MS_CLIENT_ID!,
clientSecret: process.env.MS_CLIENT_SECRET!,
redirectUri: process.env.MS_REDIRECT_URI!,
scope: ['openid', 'profile', 'email', 'User.Read'],
});Organizations only
const provider = microsoft({
clientId: process.env.MS_CLIENT_ID!,
clientSecret: process.env.MS_CLIENT_SECRET!,
redirectUri: process.env.MS_REDIRECT_URI!,
tenant: 'organizations',
});