简体   繁体   English

ASP.NET 核心 - 在 Visual Studio 2022 中授权重定向到相同的 url 而不是身份服务器的 url

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM