Google OAuth 2 authorization - swapping code for token

后端 未结 3 1796
滥情空心
滥情空心 2021-01-02 17:15

I\'m trying to implement Google OAuth 2 to get access to Google APIs. I follow this guide, using server-side scenario.

I have no problem with getting the code, serve

相关标签:
3条回答
  • 2021-01-02 17:36

    I had the same error until I realized that I was trying to connect with a client ID which I created for iOS. So for me the solution was to create a new API key-secret pair on the API Console with the platform set to "other".

    Now I'm getting other errors but that's another story. ;)

    0 讨论(0)
  • 2021-01-02 17:45

    Did you urlencode your client secret and redirect url? That works for me.

    Should be http%3A%2F%2Flocalhost instead of https://localhost.

    0 讨论(0)
  • 2021-01-02 17:53

    Happens when you use wrong Client secret. Make sure you are using correct Client secret from Google API console. I was using Email address since API console displays the information in the following order:

    1. Client ID
    2. Email address
    3. Client secret
    0 讨论(0)
提交回复
热议问题