- Navigate to Azure Active Directory > “App registrations” > “New registration”.
-
Choose a name and select a supported account type:
- Multitenant (default): allows any Microsoft account
- Single tenant: restricts to your organization
-
Set the Redirect URI:
- Platform: Web
- URL:
http://localhost:3000/api/auth/callback/microsoft(replace with your domain in production)
- Click “Register”.
-
In “Authentication”, add additional redirect URIs (replace
localhost:3000with your domain in production):http://localhost:3000/api/outlook/linking/callbackhttp://localhost:3000/api/outlook/calendar/callback(optional)http://localhost:3000/api/outlook/drive/callback(optional)
-
Get credentials from the Overview tab:
- Copy “Application (client) ID” →
MICROSOFT_CLIENT_ID - For single tenant, copy “Directory (tenant) ID” →
MICROSOFT_TENANT_ID - Go to “Certificates & secrets” > “New client secret” > copy the Value →
MICROSOFT_CLIENT_SECRET
- Copy “Application (client) ID” →
-
Configure API permissions:
- Go to “API permissions” > “Add a permission” > “Microsoft Graph” > “Delegated permissions”
- Add:
openid,profile,email,User.Read,offline_access,Mail.ReadWrite,Mail.Send,MailboxSettings.ReadWrite,Calendars.Read,Calendars.ReadWrite,Files.ReadWrite - Click “Grant admin consent” if you’re an admin.