I am developing an SPA application using AngularJS working with REST Web API, on top of a very small layer of ASP.NET MVC4. For reasons not important here, I am not using the default Account Controller of MVC4.

basically, I want to share "tasks" between users. My goal is to be able send the URL of a specific "task" entity to any user, via email. Clicking on that URL should launch the authentication. Following a successful authentication, I want to display the real task page info.

AngularJS causes my URLs to have # sign, or a URL of a page displaying the task "XYZ123" is:
<http://hostname.com/#/tasks/XYZ123>

ASP.NET redirects the unauthorized access to that URL to:
<http://hostname.com/Home/Login?ReturnUrl=%2f#/tasks/XYZ123>

This is OK, but the relevant controller method "cuts out" the path from #, so in:

```
 public ActionResult Login(string returnUrl)

```

the value of 'returnUrl' will be just "/"

So, I am losing the path: I would like to build a "Connect with Facebook" link having the original URL, like:

<http://hostname.com/Login/ExternalLogin?ReturnUrl=%2F#/tasks/XYZ123>

but I cannot.

What is the right way to solve this issue?

I can think of creating my own redirection service URL without # tag, but this solution implies additional work, and covers only a case when the system is sending a message with task URL - humans will still try to copy/paste the location URL from the browser.

Thanks for any hint.

Max