[英]ASP.NET Core - In Visual Studio 2022 for authorize redirects to same url instead of url of Identity Server
Wrong redirection to same URL with ignoring Authority URL:错误重定向到相同的 URL 忽略授权 URL:
services.AddAuthentication(options =>
{
options.DefaultScheme = "Cookies";
options.DefaultChallengeScheme = "oidc";
})
.AddCookie("Cookies", options =>
{
...
options.Cookie.HttpOnly = true;
...
}
For fixing this issue just add options.ForwardChallenge = "oidc";
要解决此问题,只需添加
options.ForwardChallenge = "oidc";
to your AddCookie part.到您的 AddCookie 部分。
Example:例子:
.AddCookie("Cookies", options =>
{
...
options.ForwardChallenge = "oidc";
...
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.