Closed benherronscope closed 3 years ago
Correct, fragments aren't supported here, and they're unlikely to be added at this point.
The best workaround at the moment is to customize the redirect in the OnApplyRedirect event. https://github.com/aspnet/AspNetKatana/blob/d196e785e277452f1382dded08ca12974d29170e/src/Microsoft.Owin.Security.Cookies/Provider/CookieAuthenticationProvider.cs#L52
Thanks for the response.
Microsoft.Owin.Security.Cookies.CookieAuthenticationOptions.LoginPath requires a Microsoft.Owin.PathString which doesn't currently support url fragments which are actually valid for a url to a login page.
e.g.
app.UseCookieAuthentication(new CookieAuthenticationOptions() { LoginPath = new PathString("/spa/#/login/"), });
will get the "#" encoded to "%23" when it shouldn't be.
PathString supports adding a QueryString via .Add() but does not support adding a FragmentString.