Google Plus Android GoogleAuthUtil.getToken()相当于iOS
使用Google OAuth 2.0 iOS SDK 1.7.1的Android GoogleAuthUtil.getToken()的iOS等价物是什么?对于iOS,使用getToken()在Android上获取代码的方法是Google Plus Android GoogleAuthUtil.getToken()相当于iOS,android,ios,authentication,google-plus,google-oauth,Android,Ios,Authentication,Google Plus,Google Oauth,使用Google OAuth 2.0 iOS SDK 1.7.1的Android GoogleAuthUtil.getToken()的iOS等价物是什么?对于iOS,使用getToken()在Android上获取代码的方法是 [GPPSignIn sharedInstance].homeServerAuthorizationCode; 在方法中 - (void)finishedWithAuth: (GTMOAuth2Authentication *)auth error: (NSError *
[GPPSignIn sharedInstance].homeServerAuthorizationCode;
在方法中
- (void)finishedWithAuth: (GTMOAuth2Authentication *)auth error: (NSError *) error
这将返回一个“一次性”代码,如下所示
4/8jjD0KiC2iCqhb6VL5FQ8Q.ckOA0UAc0hQR3oEBd8DOtNDVtIApkgI
如果服务器需要代表应用程序用户执行Google API调用,则此代码将从应用程序传递到服务器
如果服务器不需要执行googleapi调用,那么jwtid令牌可以传递给服务器进行登录身份验证
[GPPSignIn sharedInstance].idToken;
在iOS上,这是一个基于64 ish编码的Json。可以从这里用密码解码