【发布时间】:2015-09-28 22:57:36
【问题描述】:
我正在尝试Google API Objective C Client 并运行存储示例。
我注意到 API 需要客户端 ID 和客户端密码才能登录,而这是正在调用的 GTMOAuth2Authentication 函数。
+ (id)authenticationWithServiceProvider:(NSString *)serviceProvider
tokenURL:(NSURL *)tokenURL
redirectURI:(NSString *)redirectURI
clientID:(NSString *)clientID
clientSecret:(NSString *)clientSecret
我读到了这个问题:
How to get client secret from Google Developers Console in iOS?
我试过了,可以通过 Web 应用程序获取客户端密码。显然那是行不通的。我收到如下错误消息:
请求中的重定向 URI:urn:ietf:wg:oauth:2.0:oob 只能由本地应用程序的客户端 ID 使用。 'WEB' 客户端类型是不允许的。您可以在 Google Developers Console 的 Credentials 部分中为原生应用程序创建一个客户端 ID。
但我不明白如何为 iOS 应用程序获取一个客户端密码。有人知道怎么做吗?或者这个 API 有解决办法吗?
【问题讨论】:
标签: ios google-app-engine oauth google-cloud-storage