Google APIs Console - missing client secret

前端 未结 6 1911
借酒劲吻你
借酒劲吻你 2020-12-02 13:27

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 clie

相关标签:
6条回答
  • 2020-12-02 13:51

    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.

    0 讨论(0)
  • 2020-12-02 13:54

    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.

    0 讨论(0)
  • 2020-12-02 14:02

    source said that : Visit the Google Developers Console to obtain OAuth 2.0 credentials such as a client ID and client secret that are known to both Google and your application. The set of values varies based on what type of application you are building. For example, a JavaScript application does not require a secret, but a web server application does.

    0 讨论(0)
  • 2020-12-02 14:04

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

    0 讨论(0)
  • 2020-12-02 14:09

    Another solution is that you have to create a client ID with the type of "Installed Application" then you will have the Client secret

    0 讨论(0)
  • 2020-12-02 14:12

    Just today I found out that on the new Cloud Console we can see the client secret for android apps - while in the old google console we just can't.

    To use the new Cloud console, just click on the message "We are improving the experience. Try the new Cloud Console." Google will ask for a SMS confirmation. Now you'll be redirected to the new cloud console

    click this message to use the new cloud console

    Now, just select your project, click on "Registered Apps" on the left menu, selected your android app, and voilá, on oAuth 2.0 Client Id you'll see your client secret. No idea why on the old google console it's not displayed, but if you really need a client secret key, it's there.

    here we can see the client secret for android apps

    0 讨论(0)
提交回复
热议问题