检查会话端点已启用但会话ID已丢失

时间:2017-10-18 19:39:14

标签: asp.net-identity identityserver4

任何人都可以详细说明如何禁用会话端点或我可以在哪里配置正确的会话ID? 此错误发生在我使用的IdenttyServer4Microsoft.AspNetCore.Identity中? 我这与我的客户无关。我有一个IdenityServer4 (1.5.X)的已安装版本,客户端可以正常工作。 感谢

1 个答案:

答案 0 :(得分:0)

错误表示您在IdSrv中进行了身份验证,但错过了您的idsrv.session Cookie。当您覆盖IdSrv主机的auth cookie时可能会发生这种情况,但会保持会话cookie不变。在ConfigureServices寻找:

services.AddIdentityServer()
.AddInMemoryClients(Clients.Get())
.AddInMemoryIdentityResources(Resources.GetIdentityResources())
.AddInMemoryApiResources(Resources.GetApiResources())
...

services.AddAuthentication("MyCookie")
.AddCookie("MyCookie", options =>
{
    options.ExpireTimeSpan = ...;
});

如果您不是绝对确定需要它们,只需删除services.AddAuthentication().AddCookie()

相关问题