Authenticating into Google App Engine from an iOS

2019-03-30 06:17发布

I am working on an iPhone application that uses Google app engine to host the backend. I need to authenticate with Google but I can't seem to find a way to do it from my app. It seems I am down to making a UIWebView to have a user sign in to the redirected login page I am getting from Google, but I would much rather have the user enter there credentials one time and then have it persist, unless the user signs out.

Is this possible? Should I be looking at other options or am I just not handling the redirect correctly?

Any suggestions or info would be appreciated.

Thanks

2条回答
Fickle 薄情
2楼-- · 2019-03-30 06:53

This page has pretty complete information on how to access the built-in Signin flow that is included with the generated app-engine endpoint library:

https://developers.google.com/appengine/docs/python/endpoints/consume_ios

查看更多
【Aperson】
3楼-- · 2019-03-30 06:57

O-Auth is available on App Engine. Just insert GTMOAuth in your projet and present the GTMOAuthViewControllerTouch. You'll be able to store the auth token in the user's keychain.

Then authorize your NSURLMutableRequests via [auth authorizeRequest:myNSURLMutableRequest]... I think it might be easier than reusing and managing cookies.

查看更多
登录 后发表回答