Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the link for Google OAuth tokens?

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?

like image 661
Christian Hansen Avatar asked Dec 03 '15 21:12

Christian Hansen


People also ask

What is the OAuth URL?

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.

How do I get OAuth tokens on Google Drive?

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.


2 Answers

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.

like image 117
BMitch Avatar answered Jan 22 '23 02:01

BMitch


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"
like image 29
jwilleke Avatar answered Jan 22 '23 01:01

jwilleke