如果savetokens
设置为false
,则PostLogoutRedirectUris
无效。这两者之间有什么关系?我将identityserver4 1.1与asp.net core 1.1一起使用
app.UseOpenIdConnectAuthentication(new OpenIdConnectOptions
{
RequireHttpsMetadata = false,
ClientId = "openIdConnectClient",
AuthenticationScheme = "oidc",
Authority = "https://localhost:44309/",
SignInScheme = "Cookies",
Scope = { "email" },
SaveTokens = true
});
new Client
{
ClientId = "openIdConnectClient",
ClientName = "Example Implicit Client Application",
AllowedGrantTypes = GrantTypes.Implicit,
AllowedScopes = new List<string>
{
IdentityServerConstants.StandardScopes.OpenId,
IdentityServerConstants.StandardScopes.Profile,
IdentityServerConstants.StandardScopes.Email,
},
RedirectUris = new List<string>
{
"https://localhost:44378/signin-oidc"
},
PostLogoutRedirectUris = new List<string>
{
"https://localhost:44378/signout-callback-oidc"
},
}
答案 0 :(得分:0)
如果您查看注销规范
https://openid.net/specs/openid-connect-session-1_0.html#RedirectionAfterLogout
你会发现,在注销时需要id_token才能重定向回客户端应用程序。
SaveTokens
完全适合您 - 它将令牌存储在cookie中并在注销时将其发送回OP。