ASP.NET Core - In Visual Studio 2022 for authorize redirects to same url instead of url of Identity Server

Viewed 25

Wrong redirection to same URL with ignoring Authority URL:

services.AddAuthentication(options =>
{
    options.DefaultScheme = "Cookies";
    options.DefaultChallengeScheme = "oidc";
})
.AddCookie("Cookies", options =>
{
...
options.Cookie.HttpOnly = true;
...
}
1 Answers

For fixing this issue just add options.ForwardChallenge = "oidc"; to your AddCookie part.
Example:

.AddCookie("Cookies", options =>
{
...
options.ForwardChallenge = "oidc";
...
}
Related