Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not obtain Google oAuth 2 token on POSTMan

Well, since the Other problem(solved) remain unsolved, I was thinking to use POSTMan to do Trial and Error on each steps that the Client library will do.

So I read the Basic steps of Google OAuth2 again, created another OAuth 2 ID at Api Manager > Credentials in Dev Console and ID type is Web Application, and filled them into the POSTMan:

  1. New tab in POSTMan, then click the Authorization label.
  2. Choose type as OAuth 2.0 and select "Add token to the url"
  3. Auth URL: https://accounts.google.com/o/oauth2/v2/auth
  4. Access Token URL: https://www.googleapis.com/oauth2/v4/token
  5. Client ID: [the Client ID that I just received]
  6. Client Secret: [the Client secret that I just received]
  7. Scope: [empty]
  8. Grant Type: Authorization Code
  9. Request access token locally: Selected
  10. Click "Request Token"
  11. POSTMan replied me: "Could not complete OAuth2.0 login"

Do I missed something?

(Google redirect URI could be found here)

(API scope could be found here)

like image 917
Kaninchen Avatar asked Mar 23 '16 09:03

Kaninchen


1 Answers

BigHomie's suggestion of scope to 'email' worked for me as well. But I used a different Auth URL and Access Token URL than BigHomie, because I think it's been updated.

Auth URL: https://accounts.google.com/o/oauth2/auth

Access Token URL: https://accounts.google.com/o/oauth2/token

like image 192
dylretron Avatar answered Oct 09 '22 00:10

dylretron