1

I am trying the Google API Objective C Client and running the storage example.

I notice that the API requires both a client ID and client secrete to sign in and this is the GTMOAuth2Authentication function that is being called.

+ (id)authenticationWithServiceProvider:(NSString *)serviceProvider
               tokenURL:(NSURL *)tokenURL 
            redirectURI:(NSString *)redirectURI  
               clientID:(NSString *)clientID 
           clientSecret:(NSString *)clientSecret

I read about this question:

How to get client secret from Google Developers Console in iOS?

I tried it and can get a client secret with Web Application. Obviously that doesn't work. I got an error message as the following:

The redirect URI in the request: urn:ietf:wg:oauth:2.0:oob can only be used by a Client ID for native application. It is not allowed for the 'WEB' client type. You can create a Client ID for native application in the Credentials section of the Google Developers Console.

But I don't understand how to get one client secret for iOS application. Anybody know how? Or is there a work around with this API?

Community
  • 1
  • 1
Yuchen
  • 30,852
  • 26
  • 164
  • 234

1 Answers1

0

You'll need to create credentials to use from your app. Part of the credentials will be the Client ID. Also, you may want to read about using OAuth 2 to access Google APIs.

rein
  • 32,967
  • 23
  • 82
  • 106
  • Thanks, but the [link](https://developers.google.com/identity/protocols/OAuth2) is all bout the theory of OAuth 2. Do you know how to do it coding wise? – Yuchen Sep 30 '15 at 00:30