title: AngularJS and Google OAuth2 redirect_uri
body: <p>I'm trying to create a simple application using AngularJS and Google's OAuth2 for authentication.</p>
  
  <p>Due to popup-blocking issues, and mobile friendliness, I decided I wouldn't use the <a href="https://code.google.com/p/google-api-javascript-client/">Google APIs Client Library for JavaScript</a>.</p>
  
  <p>This left me with the option of doing a full redirect to the <a href="https://accounts.google.com/o/oauth2/auth">OAuth2 endpoint</a> at google, and redirect users back to my app with the access_token. </p>
  
  <p>I thought this would work just fine. The redirect URI would be '<a href="http://myapp.com/#/register">http://myapp.com/#/register</a>' with an appended 'access_token' query parameter. I would then consume the access_token and direct the user to somewhere else in my app.</p>
  
  <p>This didn't work, as the Google API credentials (<a href="http://developers.google.com/console">http://developers.google.com/console</a>) don't like having a '#' in the Redirect URI's.</p>
  
  <p>I then tried turning off the '#' requirement in URI's by using </p>
  
  <pre><code>$locationProvider.html5Mode(true);
  </code></pre>
  
  <p>This didn't work either, because explicitly browsing (in Chrome) to '<a href="http://myapp.com/register">http://myapp.com/register</a>' is not recognised by my Angular routes.</p>
  
  <p>Any thoughts on how I should acheive this?</p>