Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/192.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google Plus Android GoogleAuthUtil.getToken()相当于iOS_Android_Ios_Authentication_Google Plus_Google Oauth - Fatal编程技术网

Google Plus Android GoogleAuthUtil.getToken()相当于iOS

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 *

使用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 *) error
这将返回一个“一次性”代码,如下所示

4/8jjD0KiC2iCqhb6VL5FQ8Q.ckOA0UAc0hQR3oEBd8DOtNDVtIApkgI
如果服务器需要代表应用程序用户执行Google API调用,则此代码将从应用程序传递到服务器

如果服务器不需要执行googleapi调用,那么jwtid令牌可以传递给服务器进行登录身份验证

[GPPSignIn sharedInstance].idToken;
在iOS上,这是一个基于64 ish编码的Json。可以从这里用密码解码