0
votes


I am building an iOS app, and am having users login with google oauth. But the problem is I need only users from 'xyz.com' to be able to sign in, I own this domain, have it set up through google apps, and can access the google apps control panel, if that helps.

I know about the hosted domain argument to google oauth, but my question is how do I use it with the google SDK?

2

2 Answers

1
votes

If your app is signing in with gtm-oauth2, you can set additional parameters on the initial request, such as

viewController.signIn.additionalAuthorizationParameters = @{ @"hd" : @"example.com" };
0
votes


Sorry to answer my own question, but I used gtm-oauth2, and after a lot of digging in the source code, I figured out that I could just do this:

viewController.signIn.authorizationURL = [NSURL URLWithString:[[viewController.signIn.authorizationURL absoluteString] stringByAppendingString:@"?hd=kinokiapp.com"]];

And it would add it's parameters on to the end.