4

When i try to authenticate my app in Google Plus via Web i get an error:

Error: invalid_request Invalid parameter value for redirect_uri: Missing authority: MY_APP:/oauth2callback

I did everything according to the instructions:
https://developers.google.com/+/mobile/ios/getting-started

However, authentication with Google Plus application runs fine. What's the problem?

Amin Benarieb
  • 356
  • 4
  • 7
  • Could you post the GPPSignIn code you are using, and the version of the library? If you can, the URL you are taken to in Mobile Safari as well. – Ian Barber Mar 10 '14 at 16:41
  • I have the same issue following example on https://developers.google.com/+/mobile/ios/sign-in the only think I am wondering about give my other attempts is that I am not setting redirect_uri on the client side anywhere, but than I do not think I would have to since that is specifed on the the google console configuration. I am trying to authenticate my server not iOS client. – kos Jul 20 '14 at 15:04

2 Answers2

4

I encountered the same problem because I was using an unconventional bundle id

i.e it was not in the format com.company.appname

I found the solution here. https://code.google.com/p/google-plus-platform/issues/detail?id=961

you have to add signIn.useClientIDForURLScheme = YES;

GPPSignIn *signIn = [GPPSignIn sharedInstance];
signIn.shouldFetchGooglePlusUser = YES;
signIn.clientID = kClientId;
signIn.scopes = @[ kGTLAuthScopePlusLogin ];
signIn.delegate = self;
signIn.useClientIDForURLScheme = YES;

and then change your target->info->url types->url schemes property to the dot reverse of your client id.

eg

client id = 2299995859-8gt63glaqk4o8l3ouge3nf1qb2h1vyg3.apps.googleusercontent.com
url schema = com.googleusercontent.apps.2299995859-8gt63glaqk4o8l3ouge3nf1qb2h1vyg3
John Webb
  • 381
  • 3
  • 14
0

This may have to do with running in Simulator vs actual Device! Trying to confirm, but this is what it looks like at least right now as I get completely different and much better behavior.

kos
  • 1,357
  • 9
  • 21
  • I'm having the same issue as the OP, same behavior on simulator and devices. Curious why the callback URL posted is only using 1 backslash instead of 2. – Bill Burgess Nov 14 '14 at 15:40