-
Notifications
You must be signed in to change notification settings - Fork 378
Region Discovery Troubleshooting
AAD is adding support for regional STS (ESTS-Regional). Currently only S2S (client_credentials) flow and available via opt-in.
If you know the region - use it. If you don't know the region, MSAL can attempt auto-discovery. This works for some Azure systems, such as some VMs and Azure Functions. If the auto-detection fails, the non-regional authority is used.
// if app knows the region, use it as MSAL cannot reliably detect it
string region = Config.Region ?? ConfidentialClientApplication.AttemptRegionDiscovery;
var cca = ConfidentialClientApplicationBuilder(client_id)
.WithAuthority(AzureCloud.PublicCloud, validateAuthority:false)
.WithRegion(region)
.Build();Authority validation is not currently supported for regional Azure authorities. You can set the validateAuthority flag to false to use Azure Regional authority. Do not disable authority validation if you read the authority from an untrusted source, for example from the WWWAuthenticate header of an HTTP request that resulted in a 401 response. Disable authority validation if the authority comes from a trusted source such as Config file, or if you hardcode it to "https://login.microsoftonline.com/" or similar.
AADSTS700023: Client assertion audience claim does not match Realm issuer. is thrown if an invalid regional authority is used.
- Home
- Why use MSAL.NET
- Is MSAL.NET right for me
- Scenarios
- Register your app with AAD
- Client applications
- Acquiring tokens
- MSAL samples
- Known Issues
- Acquiring a token for the app
- Acquiring a token on behalf of a user in Web APIs
- Acquiring a token by authorization code in Web Apps
- AcquireTokenInteractive
- WAM - the Windows broker
- .NET Core
- Maui Docs
- Custom Browser
- Applying an AAD B2C policy
- Integrated Windows Authentication for domain or AAD joined machines
- Username / Password
- Device Code Flow for devices without a Web browser
- ADFS support
- High Availability
- Regional
- Token cache serialization
- Logging
- Exceptions in MSAL
- Provide your own Httpclient and proxy
- Extensibility Points
- Clearing the cache
- Client Credentials Multi-Tenant guidance
- Performance perspectives
- Differences between ADAL.NET and MSAL.NET Apps
- PowerShell support
- Testing apps that use MSAL
- Experimental Features
- Proof of Possession (PoP) tokens
- Using in Azure functions
- Extract info from WWW-Authenticate headers
- SPA Authorization Code