I try to use OAuth with google. I receive a code using a POST request to this URL:
https://accounts.google.com/o/oauth2/v2/auth
Then I try to get a access token by sending a POST request to this URL:
https://www.googleapis.com/oauth2/v4/token
But this returns me a HTTP 404 "Not found" error. Is this URL wrong?
OAuth, which is pronounced "oh-auth," enables an end user's account information to be used by third-party services, such as Facebook and Google, without exposing the user's account credentials to the third party.
Procedure. Go to Google Developers OAuth Playground. Click OAuth 2.0 Configuration and select Use your own OAuth credentials check box, enter the OAuth client ID and client secret you have already created in the OAuth Client ID and OAuth Client secret fields respectively.
The URI that I've gotten to work for an Oauth2 token right now is
https://www.googleapis.com/oauth2/v3/token
I saw the same "v4" referenced in documentation, but couldn't get it to work either.
If you're developing your own OAuth 2.0 clients on the Google infrastructure, I'd recommend Google's OAuth 2.0 Playground which takes you through each request and response for their API's.
Oauth has been deprecated by Google. For OAuth 2.0, Try their well-known OpenID Configuration link which shows:
"authorization_endpoint": "https://accounts.google.com/o/oauth2/v2/auth"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With