Tag: gtm oauth2

GTM OAuth不下载刷新令牌 – iOS

我正在使用Google的GTMOAuth for iOS / Mac SDK,以便能够连接诸如YouTube API和Instagram API之类的APIS。 这一切工作正常,但是当用户身份validation,我只能得到访问令牌。 这一切都很好,但过了一段时间访问令牌到期,用户不得不重新login这是可怕的。 我的问题是,当用户身份validation,我只能得到一个访问令牌,没有别的… 感谢您的帮助:)

使用GTMOAuth2检索login时的Gmail地址

我用我的企业应用程序在iOS上使用GTMOAuth2进行login。 scheme只有拥有account @ mycompanyname.com的用户才能login。 问题是我打电话给文档提供的方法,但我无法检索用户的电子邮件帐户,他用来login。 呼叫login如下: _auth = [self authForGoogle]; // Display the authentication view GTMOAuth2ViewControllerTouch * viewController = [[GTMOAuth2ViewControllerTouch alloc] initWithAuthentication:_auth authorizationURL:[NSURL URLWithString:GoogleAuthURL] keychainItemName:@"GoogleKeychainName" delegate:self finishedSelector:@selector(viewController:finishedWithAuth:error:)]; [_window setRootViewController: viewController]; [_window makeKeyAndVisible]; 在我GTMOAuth2的委托方法中,我做了这个尝试检索电子邮件地址: – (void)viewController:(GTMOAuth2ViewControllerTouch * )viewController finishedWithAuth:(GTMOAuth2Authentication * )auth error:(NSError * )error { if ([[_auth userEmail] rangeOfString:@"@mycompanyname.com"].location == NSNotFound && error != nil ) […]