title: How to redirect to the return URL in token based authentication
body: <p><strong>Description</strong></p>
  
  <p>In my mobile application, the user tries to access a resource which requires authentication.</p>
  
  <p>After logging in and obtaining the access token, I want to redirect them to the originally requested page (the return Url).</p>
  
  <p><strong>Question</strong></p>
  
  <p>In a token-based authentication, how to redirect to the return url?</p>
  
  <p><strong>Example</strong></p>
  
  <p>Consider this scenario:</p>
  
  <p>1 - I have a menu in my mobile application "My Profile" which opens a <em>WebView</em> and navigates to <code>mycoolwebsite.com/myprofile</code>.</p>
  
  <p>2 - The server (MVC controller) redirects to a <em>Login Page</em> with the returnUrl as in the URL. <code>mycoolwebsite.com/login?returnUrl='/myprofile'</code> because user cannot access <code>mycoolwebsite.com/profile</code> without logging in.</p>
  
  <p>3 - User sees a <em>Login Page</em>, they enter their username and password, and press the Login button.</p>
  
  <p>4 - A <code>POST</code> request will be send to the _Token Endpoint _ of the ASP.NET application, including username and password and <code>grant_type</code> of <code>password</code></p>
  
  <p>5 - The server validates the credentials, and issues a <em>Token</em>. It will send the token back to the client as a JSON object.</p>
  
  <p>Problem: after obtaining the Token, I need to redirect the user back to <code>mycoolwebsite.com/profile</code> which they originally requested.</p>
  
  <p>In an ASP.NET MVC application, this happens automatically with the MVC template.</p>
  
  <p>However in WebAPI, I'm not sure what is the proper way to do this.</p>