fastmcp.server.auth.providers.azure
Azure (Microsoft Entra) OAuth provider for FastMCP.
This provider implements Azure/Microsoft Entra ID OAuth authentication
using the OAuth Proxy pattern for non-DCR OAuth flows.
Classes
AzureProviderSettings
Settings for Azure OAuth provider.
AzureTokenVerifier
Token verifier for Azure OAuth tokens.
Azure tokens are JWTs, but we verify them by calling the Microsoft Graph API
to get user information and validate the token.
Methods:
verify_token
AzureProvider
Azure (Microsoft Entra) OAuth provider for FastMCP.
This provider implements Azure/Microsoft Entra ID authentication using the
OAuth Proxy pattern. It supports both organizational accounts and personal
Microsoft accounts depending on the tenant configuration.
Features:
- Transparent OAuth proxy to Azure/Microsoft identity platform
- Automatic token validation via Microsoft Graph API
- User information extraction
- Support for different tenant configurations (common, organizations, consumers)
- Register an application in Azure Portal (portal.azure.com)
- Configure redirect URI as: http://localhost:8000/auth/callback
- Note your Application (client) ID and create a client secret
- Optionally note your Directory (tenant) ID for single-tenant apps