⚠️ Important: The screenshots and step-by-step instructions on this page
reflect the interface as of December 2025. Third-party services like Google, Facebook,
and Microsoft frequently update their user interfaces. While the general process remains
similar, the exact screens, button labels, and menu locations may differ from what you see.
If you encounter significant differences, consult the provider's official documentation.
This guide walks you through setting up Microsoft OAuth authentication
for your site using Azure Active Directory.
Quick Setup (Already Have Credentials?)
If you already have a Microsoft/Azure App Registration with Client ID and Secret, just add them to appsettings.json:
For Development: Use User Secrets instead of appsettings.json:
dotnet user-secrets set "Authentication:Microsoft:ClientId" "your-client-id"
dotnet user-secrets set "Authentication:Microsoft:ClientSecret" "your-client-secret"
The redirect URI in your request doesn't match any configured URIs.
Verify the URI is exactly correct in Azure, including protocol and trailing slashes.
Error: AADSTS7000218 - Invalid client secret
The client secret may have expired or been entered incorrectly.
Create a new secret in Azure and update your configuration.
Error: AADSTS65001 - User or admin hasn't consented
The user needs to grant consent. For admin consent, an administrator
must approve the app in Azure AD.
Error: AADSTS700016 - Application not found
The Client ID is incorrect or the app was deleted.
Verify the Application (client) ID in Azure.