【问题标题】:How to get client secret for iOS for Google Cloud Storage如何为 Google Cloud Storage 获取 iOS 的客户端密码
【发布时间】: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


    【解决方案1】:

    您需要create credentials 才能在您的应用中使用。部分凭据将是客户端 ID。 另外,您可能想了解using OAuth 2 to access Google APIs

    【讨论】:

    • 谢谢,但link 完全是关于 OAuth 2 的理论。你知道如何明智地进行编码吗?
    猜你喜欢
    • 2015-11-11
    • 1970-01-01
    • 1970-01-01
    • 2021-04-26
    • 1970-01-01
    • 1970-01-01
    • 2014-08-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多