mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-01 06:33:11 +02:00
Update AzureADAuthenticationMatcher to support V2 Azure AAD tokens (#1288)
* Update AzureADAuthenticationMatcher to support V2 Azure AAD tokens * fix ;-) * add tests * Update test/WireMock.Net.Tests/Authentication/MockJwtSecurityTokenHandler.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * . * WIREMOCK_AAD_TENANT * update logging * throw new SecurityTokenInvalidIssuerException($"tenant {extractedTenant} does not match {_tenant}."); --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -514,7 +514,11 @@ public partial class WireMockServer : IWireMockServer
|
||||
#if NETSTANDARD1_3
|
||||
throw new NotSupportedException("AzureADAuthentication is not supported for NETStandard 1.3");
|
||||
#else
|
||||
_options.AuthenticationMatcher = new AzureADAuthenticationMatcher(tenant, audience);
|
||||
_options.AuthenticationMatcher = new AzureADAuthenticationMatcher(
|
||||
new System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler(),
|
||||
new Microsoft.IdentityModel.Protocols.ConfigurationManager<Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfiguration>($"https://login.microsoftonline.com/{tenant}/.well-known/openid-configuration", new Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfigurationRetriever()),
|
||||
tenant,
|
||||
audience);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user