This repository was archived by the owner on Dec 13, 2018. It is now read-only.
This repository was archived by the owner on Dec 13, 2018. It is now read-only.
Map causes wrong ReturnUrl parameter for Cookies #1730
Closed
Description
app.UseAuthentication();
app.Map("/hello", map =>
{
map.Run(async context =>
{
if (!context.User.Identities.Any(identity => identity.IsAuthenticated))
{
await context.ChallengeAsync();
return;
}
context.Response.ContentType = "text/plain";
await context.Response.WriteAsync("Hello old timer");
});
});
If UseAuthentication is outside of the Map, and ChallengeAsync is called inside the Map, then CookieAuth generates the wrong ReturnUrl parameter.
In the example http://localhost:12345/hello/world?query
, it uses the OriginalPathBase (empty) but the current request Path "/world" and redirects to "/world?query". It should use the OriginalPathBase "" and the OriginalPath "/hello/world" rather than the current Path.