New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SignIn fails when serverClientID specified #51
Comments
Just to check, what was the version of the YouTube app (or other Google app used for auth)? From reading your description it doesn't sound like you made a mistake, but for reference: did you put the serverClientID setting before or after the call to configureWithError |
Hi @ianbarber, thanks for reply. In example provided in "pod test Google > Sign In" It was YouTube app v10.31.11670. If I delete it from device, then my app uses WebView to authorise although I have Google Hangouts, Google Docs, Google Sheets, Google Drive on my device. Seems like these apps don't provide auth capability. And as I mentioned before, authorisation using WebView works just fine. I even tried this app on another iPhone 6 and had the same results. |
I am experiencing the same issue. Auth works fine if I don't use a serverClientID, the problem is that I need this in order to retrieve a serverAuthCode for our server. |
@mjgaylord As a temporary solution you can use subclass of UIApplication and rewrite it's canOpenUrl method (you can find it in my original message). Don't forget to put your UIApplications subclass name to Info.plist with NSPrincipalClass key. |
@DimGun Thanks! I will try that next. I am trying with a different bundle ID right as I saw in another issue that certain characters in bundle IDs might be causing the problem. |
@mjgaylord My application bundleId contains only allowed characters [a-z.]. |
Yeah, I can confirm that that bundle ID is not the issue. It's unfortunate that we need to use this hack, since it means that users need to go through the entire web login process in order to authenticate themselves in my app and if they have 2-factor auth enabled, it's even more friction for them. |
Just updated my pods to the latest version and this fix doesn't work any longer. There doesn't seem to be any way of preventing the SDK from opening a Google app as it doesn't inspect |
Tested this now with the current pod version and I'm seeing sign in happen in-app, its not switching to YouTube. I'll mark this as closed, but if anyone is seeing it on the latest pod, please reopen and include any pertinent details! |
Hi, guys! I've got a server that interacts with Google Calendar on behalf of user. To do this it should obtain one-time access token from iOS application. I've referred to documentation, but have some issues with sign in.
I started from "SignIn" example app (pod test Google > Sign In), provided it with my credentials (GoogleServices-Info.plist, bundleId). Then I signed it with my provision and started on iPhone 6, everything works like a charm.
Then I added
in ViewController:viewDidLoad. And then after opening auth screen (youtube.app, 10.31.11670), and selecting the same account, it launched my app (permissions screen is not presented),
-signIn:didSignInForUser:withError:
method was called, butGIDGoogleUser
was nil. Error statedI tried several times, but each time I received the same result. But if I comment
...serverClientID...
it begins to work again.Then I launched this app in simulator and it authorised successfully using WebView and I received
user.serverAuthCode
.I decided that problem was in YouTube.app, I uninstalled it from device, but the same problem happened with other Google applications.
Could you point me what is wrong with my singIn implementation?
PS
Finally I decided to use workaround and rewrote
-canOpenUrl:
in UIApplication subclass this way:And now it uses WebView authorisation and I can receive my one-time token. But it's a bit crappy of course.
The text was updated successfully, but these errors were encountered: