我一直在关注this Google page,它描述了如何在IOS下对App-Engine(云端点)后端进行身份验证。没关系。但是,似乎需要在每次运行程序时重新签名。
有没有办法
如果IOS版本的行为与Android版本一样好,当然不需要登录步骤,因为它直接由操作系统处理。
谢谢!
答案 0 :(得分:0)
我现在已经解决了这个问题。我不知道在第一次通过时我是如何在文档中错过的。
请参阅https://code.google.com/p/gtm-oauth2/wiki/Introduction
上的“从钥匙串中检索授权”GTMOAuth2Authentication* auth =
[GTMOAuth2ViewControllerTouch
authForGoogleFromKeychainForName:AUTH_KEYCHAIN_NAME
clientID:IOS_CLIENT_ID
clientSecret:IOS_CLIENT_SECRET];
if ([auth canAuthorize]) {
// add existing auth to our GTLServiceFoo, cleverly named "fooEndpoint"
[fooEndpoint setAuthorizer:auth];
} else {
// go through sign-in dialog flow and add the auth resulting from that
...
}