ale*_*sio 4 azure openid-connect .net-core identityserver4 google-openidconnect
我正在尝试在我的应用程序中添加 Google 和 Azure Active Directory 权限作为 OpenIdConnect 选项。
如果我分别添加它们中的每一个,它就可以正常工作。但是,如果我将它们都添加,则会收到以下错误消息:
无法取消对消息的保护。状态
这些是 OpenIdConnectOptions 配置:
//Google
appBuilder.UseOpenIdConnectAuthentication(new OpenIdConnectOptions
{
ClientId = ".....apps.googleusercontent.com",
Authority = $"https://accounts.google.com",
ClientSecret = "xxxyyyzzzz",
AuthenticationScheme = "Google",
DisplayName = "Google",
AutomaticChallenge = true
});
//Azure AD Providers
var schemeName = "Azure Active Directory";
var clientId = "1234567890";
var tenantId = "0987654321";
appBuilder.UseOpenIdConnectAuthentication(new OpenIdConnectOptions
{
ClientId = clientId,
ClientSecret = "aaaaabbbbcccc",
Authority = $"https://login.microsoftonline.com/{tenantId}",
AuthenticationScheme = "Azure Active Directory",
DisplayName = "Azure Active Directory",
AutomaticChallenge = true,
});
Run Code Online (Sandbox Code Playgroud)
当您有多个 OIDC 中间件时,您需要CallbackPath为每个中间件设置一个唯一的。否则他们在处理回调时会踩到对方的脚趾。
| 归档时间: |
|
| 查看次数: |
2430 次 |
| 最近记录: |