title: redirect_uri_mismatch while trying to authenticate with Google API
body: <p>I have a tricky problem. I have a need to start a Google Authentication using an iOS app and hand off the <code>code</code> value that Google API returns to a server end point that I created. This works perfectly fine if I was initiating the request from a <code>JavaScript</code> application. <a href="https://developers.google.com/identity/sign-in/web/server-side-flow" rel="nofollow">Here</a> the Google Documentation.</p>
  
  <p>However, if I initate the request from the iOS app using the following code, it comes back and say I have a URI Mismatch because the oAuth ID I created if a <code>Web Application</code> type. If I use <code>Other</code>, I'll get another error, which is <code>Error fetching OAuth2 access token, message: 'invalid_grant: Invalid code.'.</code></p>
  
  <p>Having said that, here is how I'm initiating the auth from the iOS app.</p>
  
  <pre><code>NSString *urlString = @"https://accounts.google.com/o/oauth2/token";
  NSURL *tokenURL = [NSURL URLWithString:urlString];
  
  // We'll make up an arbitrary redirectURI.  The controller will watch for
  // the server to redirect the web view to this URI, but this URI will not be
  // loaded, so it need not be for any actual web page.
  NSString *redirectURI = @"urn:ietf:wg:oauth:2.0:oob";
  GTMOAuth2Authentication *auth = [GTMOAuth2Authentication authenticationWithServiceProvider:@"Google"
                                                                                    tokenURL:tokenURL
                                                                                 redirectURI:redirectURI
                                                                                    clientID:kClientID
                                                                                clientSecret:kClientSecret];
  </code></pre>
  
  <p>Do you see any glaring issues?</p>