Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google APIs Console - missing client secret

Tags:

oauth-2.0

I tried to create a testing client id for an android app which uses OAUTH 2.0 as login for retrieving user profile. I followed the steps to complete the creation of the client id on google console, but I do not see anywhere the client secret. I'm trying to help my employer with getting google credentials for it's app. I know how to implement OAUTH 2.0 in android, but I need client secret to exchange the code with access token.

First, I selected "Google+ API" from Services tab. Then followed the on screen steps from API Access tab.enter image description here

like image 548
Alexandru Circus Avatar asked Jul 02 '12 14:07

Alexandru Circus


People also ask

Where is client secret in Google API console?

Get a client ID and client secretOpen the Google API Console Credentials page. From the project drop-down, select an existing project or create a new one. On the Credentials page, select Create credentials, then select OAuth client ID. Under Application type, choose Web application.

How do I get Google client secret?

High-level procedure: In the Google Admin console or the Google Cloud Platform console, select or create a project. Define a consent screen for you to use to authorise a request to get an access token and refresh token. Get an OAuth client ID and secret.

Should Google client id be hidden?

You don't need to hide the client ID, provided that you restricted access to specific JavaScript origins and redirect URI's on the server side.


3 Answers

It seems that Google finally ditched the unnecessary client_secret for installable applications and is not yet up-to-date with their documentation. You should check if you already get an access_token in the initial OAuth request like it's handled on Facebook.

Another possibility would be to fall back to using a Simple API Access key.

Update:

First method seems to not work with Google.

The recommended way for Android is to use AccountManager instead of baking your own requests. Follow this example to see how this is implemented and how you get an AuthToken using a Simple API Access key. Instead of using the Tasks API you can then include the OAuth2 API library to retrieve the userinfo.

like image 151
Jan Gerlinger Avatar answered Oct 23 '22 22:10

Jan Gerlinger


Click on "Download JSON " Is it what you're looking for ? enter image description here

like image 37
George Nguyen Avatar answered Oct 23 '22 22:10

George Nguyen


Since almost everything from the accepted answer has been deprecated, I thought I'd share what I've found.

I needed the People API which requires a client secret. What Google recommends for using People API with Android is,

Select the application type Other, enter the name "People API Quickstart", and click the Create button.

Found here: https://developers.google.com/people/quickstart/java (Step 1 part e)

So if you need a client secret, you might consider using the Other type. Of course, follow the documentation for your specific API first.

like image 36
Bobby Puckett Avatar answered Oct 23 '22 21:10

Bobby Puckett