Asp.net core SaveTokens和postLogoutRedirecuturis之间有关系吗?
如果Asp.net core SaveTokens和postLogoutRedirecuturis之间有关系吗?,asp.net-core,identityserver4,Asp.net Core,Identityserver4,如果savetokens设置为false则postlogutredirecturis不起作用。这两者之间有什么关系?我将identityserver4 1.1与asp.net core 1.1一起使用 app.UseOpenIdConnectAuthentication(new OpenIdConnectOptions { RequireHttpsMetadata = false, ClientId = "openIdConnectClient", Authenticat
savetokens
设置为false
则postlogutredirecturis
不起作用。这两者之间有什么关系?我将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"
},
}
app.UseOpenIdConnectAuthentication(新的OpenIdConnectOptions
{
RequireHttpsMetadata=false,
ClientId=“openIdConnectClient”,
AuthenticationScheme=“oidc”,
权威=”https://localhost:44309/",
signnscheme=“Cookies”,
作用域={“电子邮件”},
SaveTokens=true
});
新客户
{
ClientId=“openIdConnectClient”,
ClientName=“示例隐式客户端应用程序”,
AllowedGrantTypes=GrantTypes.Implicit,
AllowedScopes=新列表
{
IdentityServerConstants.StandardScopes.OpenId,
IdentityServerConstants.StandardScopes.Profile,
IdentityServerConstants.StandardScopes.Email,
},
重定向URI=新列表
{
"https://localhost:44378/signin-oidc“
},
PostLogoutRedirectUris=新列表
{
"https://localhost:44378/signout-回调oidc“
},
}
如果您检查注销规范
您将发现,在注销时需要id_令牌才能重定向回客户端应用程序
SaveTokens
正是为您这样做的-它将令牌存储在cookie中,并在注销时将其发送回OP。非常感谢您