使用 Google Toolbox for Mac OAuth for Google App Engine
我正在尝试使用 OAuth 将 iOS 应用程序与 Google App Engine 集成。我发现 GTM 有一个 OAuth 控制器 - http://code.google.com/p /gtm-oauth/
可以用来连接 Google App Engine 吗?如果是这样,我应该在
- (id)initWithScope:(NSString *)scope
language:(NSString *)language
appServiceName:(NSString *)keychainAppServiceName
delegate:(id)delegate
finishedSelector:(SEL)finishedSelector;
我尝试使用我的 App Engine 应用程序的地址 (http://my-app-name.appspot.com),但它不起作用。
提前致谢!
I am trying to integrate an iOS application with Google App Engine using OAuth. I found that GTM has an OAuth Controller -- http://code.google.com/p/gtm-oauth/
Can it be used to connect to Google App Engine? If so, what do I put as the "scope" parameter in
- (id)initWithScope:(NSString *)scope
language:(NSString *)language
appServiceName:(NSString *)keychainAppServiceName
delegate:(id)delegate
finishedSelector:(SEL)finishedSelector;
I've tried to use my App Engine application's address (http://my-app-name.appspot.com) but it didn't work.
Thanks in advance!
btw this is sort of a follow up question to Authenticating into Google App Engine from an iOS device.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我知道这是一个较晚的答案,但希望这会对某人有所帮助:
MYSITE 可以是类似 Thunderofthor.com 的内容
步骤 1:
为感兴趣的 App Engine 域设置 2 足 OAuth。为此,请以管理员身份登录 https://www.google.com/a/MYSITE。在高级工具下,单击管理 OAuth 域密钥。在这里,单击“启用此消费者密钥”和“允许访问所有 API”以启用这些选项。在 Google 方面,您现在可以处理使用 MYSITE 用户密钥和 OAUTHCONSUMERSECRET 的请求。
步:
在您的 servlet 代码中,您可以通过请求 OAuthConsumerKey(即 MYSITE)来确认客户端具有正确的凭据
第2
。 com/p/gtm-oauth/wiki/GTMOAuthIntroduction" rel="nofollow">GTMOAuth 来自 Google 的软件包。它将允许 iOS 轻松地与您的服务器通信。您不需要整个包来进行 2 足身份验证。事实上,您所需要的只是 GTMOAuthAuthentication 文件。要在您的代码中使用,请执行以下操作:
那里!轻松安全通信,无需用户名和密码!
A late answer I know, but hopefully this will help someone:
MYSITE can be something like thunderofthor.com
Step 1:
Set up 2-legged OAuth for the App Engine domain of interest. To do this, log in as admin to https://www.google.com/a/MYSITE. Under advanced tools, click Manage OAuth domain key. Here, click 'Enable this consumer key' and 'Allow access to all APIs' to enable those options. On Google's side, you can now handle requests that use the MYSITE consumer key and the OAUTHCONSUMERSECRET.
Step 2:
In your servlet code, you can confirm the client has the correct credentials by requesting the OAuthConsumerKey which will be MYSITE
Step 3:
Download the GTMOAuth package from Google. It will allow iOS to talk to your server effortlessly. You won't need the whole package for 2-legged auth. In fact, all you need is the GTMOAuthAuthentication files. To use in your code, do something like the following:
There! Effortless secure communication without requiring usernames and passwords!