asp.net-core - 跨子域和 SecurityStampValidatorOptions 的 ASP.NET Core 3.1 身份 cookie
问题描述
有人帮我解决这个问题吗?
我有
services.AddIdentity<User, IdentityRole>(...)
接着
services.ConfigureApplicationCookie(options =>
{
options.Cookie.Name = "somename";
options.Cookie.Domain = ".somename"
options.Events = new CookieAuthenticationEvents()
{
OnRedirectToLogin = (context) =>
{
context.HttpContext.Response.Redirect("somesite/login/));
return Task.CompletedTask;
},
};
options.ReturnUrlParameter = CookieAuthenticationDefaults.ReturnUrlParameter;
});
最后:
services.Configure<SecurityStampValidatorOptions>(options =>
{
options.ValidationInterval = TimeSpan.FromSeconds(10);
});
授权完美地在所有域上进行。但是最后一项服务无法正常工作。例如,当我更新用户角色时。您需要注销并重新登录。
如何解决这个问题?谢谢。
解决方案
推荐阅读
- google-apps-script - Google 云端硬盘 - 导入工作表
- exoplayer - 如何让变形视频与 exoplayerleaback 一起使用?
- python - 在另一个函数中调用一个函数
- javascript - React Native 运行 Android 错误(在 checkExecSyncError (child_process.js:621:11) 处)
- mysql - 如何以其他用户身份运行 mysql 查询
- ruby-on-rails - 使用视图中的按钮触发操作时出错
- c# - GroupJoin 在实体框架中引发错误。加入工作正常
- server - 在调整 linode 磁盘大小之前,我应该采取哪些预防措施?
- node.js - 父数组不允许 JOI npm 库
- javascript - 使用 for 循环创建一个 javascript 函数,该函数返回偶数的数量(数量)而不是实际的偶数