具有多个绑定的IdentityServer 4

时间:2018-10-23 14:29:07

标签: single-sign-on identityserver4

我有2个网站(www.dogsite.com和www.catsite.com)。它们被指向login.identityserverdemo.com作为我的授权服务器。这使SSO可以在两个站点之间工作。现在,如果我在我的login.identityserverdemo.com网站上再添加两个绑定,分别称为login.dogsite.com和login.catsite.com,我将失去SSO。我尝试将www.dogsite.com和www.catsite.com添加到客户端的redirectUrls中而没有任何改进。

这是我的客户端配置:

            new Client
            {
                ClientId = "mvc-dog",
                ClientName = "MVC Client For Dog Site",
                AllowedGrantTypes = GrantTypes.HybridAndClientCredentials,
                RequireConsent = false,
                ClientSecrets =
                {
                    new Secret("woofwoof123".Sha256())
                },
                Claims = new List<Claim>
                { },

                RedirectUris           = { "http://www.catsite.com/signin-oidc", "http://www.dogsite.com/signin-oidc" },
                PostLogoutRedirectUris = { "http://www.catsite.com/signout-callback-oidc","http://www.dogsite.com/signout-callback-oidc" },

                AllowedScopes =
                {
                    IdentityServerConstants.StandardScopes.OpenId,
                    IdentityServerConstants.StandardScopes.Profile,
                    "api1"
                },
                AllowOfflineAccess = true
            },
            new Client
            {
                ClientId = "mvc-cat",
                ClientName = "MVC Client For Cat Site",
                AllowedGrantTypes = GrantTypes.HybridAndClientCredentials,
                RequireConsent = false,
                ClientSecrets =
                {
                    new Secret("MeowMeow456".Sha256())
                },

                Claims = new List<Claim>
                {},

                RedirectUris           = { "http://www.catsite.com/signin-oidc", "http://www.dogsite.com/signin-oidc" },
                PostLogoutRedirectUris = { "http://www.catsite.com/signout-callback-oidc","http://www.dogsite.com/signout-callback-oidc" },

                AllowedScopes =
                {
                    IdentityServerConstants.StandardScopes.OpenId,
                    IdentityServerConstants.StandardScopes.Profile,
                    "api1"
                },
                AllowOfflineAccess = true
            }

请帮助?

1 个答案:

答案 0 :(得分:0)

您丢失了SSO,因为login.dogsite.com和login.catsite.com无法访问相同的idSrv cookie。

签出Cross domain cookie option。它适用于ID3,但同样适用于ID4。