我正在使用下面的代碼來驗證AAD訪問令牌。如何使用OWIN從PPE環境驗證AAD令牌?
app.UseWindowsAzureActiveDirectoryBearerAuthentication(
new WindowsAzureActiveDirectoryBearerAuthenticationOptions
{
Tenant = ConfigSettings.MicrosoftAadTenant,
TokenValidationParameters = new TokenValidationParameters
{
ValidateAudience = false,
ValidateIssuer = false
}
});
代碼工作正常,直到我切換到使用來自PPE環境生成的令牌,它的國際空間站是「https://sts.windows-ppe.net/ ......」。我在下面粘貼了錯誤信息。你知道如何解決它嗎?
Microsoft.Owin.Security.OAuth.OAuthBearerAuthenticationMiddleware Error: 0 : Authentication failed System.IdentityModel.Tokens.SecurityTokenSignatureKeyNotFoundException: IDX10500: Signature validation failed. Unable to resolve SecurityKeyIdentifier: 'SecurityKeyIdentifier ( IsReadOnly = False, Count = 2, Clause[0] = X509ThumbprintKeyIdentifierClause(Hash = 0x871BE0E2BDD307841D01C8151AE2717D2DB9F376), Clause[1] = System.IdentityModel.Tokens.NamedKeySecurityKeyIdentifierClause ) ',
感謝,