Normally it wouldn't be a big deal, but I'm building an AngularJS app, and the # added by ASP.NET's Identity external login (OWIN based) is wreaking havoc on the angularjs app.
You can see it even on a default new C# ASP.NET MVC site with Google uncommented in Startup.Auth.cs.
A # gets added to the end of the url when a user is logged in and redirected. I've tried handling this redirection on my own, but to no avail... a hash tag always gets added.
Any ideas? Thanks in advance.
Update
The default solution uses a form to initiate the external login, like so:
using (Html.BeginForm(action, "Account", new { ReturnUrl = returnUrl }))
{
@Html.AntiForgeryToken()
<div id="socialLoginList">
<p>
@foreach (AuthenticationDescription p in loginProviders)
{
<button type="submit" class="btn btn-default" id="@p.AuthenticationType" name="provider" value="@p.AuthenticationType" title="Log in using your @p.Caption account">@p.AuthenticationType</button>
}
</p>
</div>
}
I don't see anything in that adding a # to request.
If you look at the Login action, you'll see it calls its own private method to handle redirect:
private ActionResult RedirectToLocal(string returnUrl) {
if (Url.IsLocalUrl(returnUrl)) {
return Redirect(returnUrl);
}
else {
return RedirectToAction("Index", "Home");
}
}
Even when return RedirectToAction("Index", "Home"); is hit it has a # at the end of the url.
I've tried hard coding the return like so: return Redirect("/home/index"); but that also still has the # at the end.
Update 2 Looks like it only happens in Chrome.