UseOpenIdConnectAuthentication - 无法取消保护message.State错误消息

时间:2017-05-03 11:33:03

标签: azure .net-core openid-connect 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,                                                
        });

1 个答案:

答案 0 :(得分:2)

如果您有多个OIDC中间件,则需要为每个中间件设置唯一的CallbackPath。否则他们在处理回调时会踩到对方的脚趾。