Re: using gtm oauth sample ios app get "invalid_client" error

662 views
Skip to first unread message

Greg Robbins

unread,
Aug 20, 2012, 3:28:06 AM8/20/12
to gtm-o...@googlegroups.com
To use gtm-oauth2, be sure the client ID obtained from the Google API Console is for an installed application type "Other", not type "iOS".

mpf

unread,
Aug 20, 2012, 9:13:19 PM8/20/12
to gtm-o...@googlegroups.com, Nicolas Flacco


On Sunday, August 19, 2012 9:40:52 PM UTC-7, mpf wrote:
i am trying to learn how to use OAuth2 and I am using the OAuth2SampleAppDelegateTouch iOS app. I have setup a Client ID for installed applications. I enter the correct client ID and client secret. I am redirected to the google login page which successfully logs in and redirects to the consent page,i click ok and am redirected to the app but in the app log i get

2012-08-19 21:16:02.255 OAuthSampleTouch[79083:c07] Authentication error: Error Domain=com.google.HTTPStatus Code=400 "The operation couldn’t be completed. (com.google.HTTPStatus error 400.)" UserInfo=0x10d3cf20 {data=<7b0a2020 22657272 6f722220 3a202269 6e76616c 69645f63 6c69656e 74220a7d>, json=<CFBasicHash 0x10d59e60 [0x16a7b48]>{type = mutable dict, count = 1,
entries =>
        2 : <CFString 0x10d59c60 [0x16a7b48]>{contents = "error"} = <CFString 0x10d5be50 [0x16a7b48]>{contents = "invalid_client"}
}
}
any suggestions appreciated

Wow! that was it! Thank you, I would have never thought to use "other". If I can ask a silly question, if you don't use "iOS" when working with iOS when do you use it? 

Greg Robbins

unread,
Aug 20, 2012, 9:34:41 PM8/20/12
to gtm-o...@googlegroups.com
The GTM OAuth2 documentation mentions that the client ID should be created with the "other" option.

http://code.google.com/p/gtm-oauth2/wiki/Introduction#Registering_Your_Application
 

If I can ask a silly question, if you don't use "iOS" when working with iOS when do you use it? 

It's poorly labeled on the site, but the iOS option is for client IDs issued for use with the Google+ SDK for iOS, which offers a different mechanism for signing in to Google accounts.

mpf

unread,
Aug 20, 2012, 9:40:38 PM8/20/12
to gtm-o...@googlegroups.com
I completely missed that in the documentation. Thanks again.
Reply all
Reply to author
Forward
0 new messages