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 Trail 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:

  • New tab in POSTMan, then click the Authorization label.
  • Choose type as OAuth 2.0 and select "Add token to the url"
  • Auth URL: https://accounts.google.com/o/oauth2/v2/auth
  • Access Token URL: https://www.googleapis.com/oauth2/v4/token
  • Client ID: [the Client ID that I just received]
  • Client Secret: [the Client secret that I just received]
  • Scope: [empty]
  • Grant Type: Authorization Code
  • Request access token locally: Selected
  • Click "Request Token"
  • 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)


    You get access Token only when a Google User Logs in through the google signin page.

    Step 1: Redirect https://accounts.google.com/o/oauth2/auth?client_id=" + GoogleClientID + "&redirect_uri=" + Url.Encode(GoogleRedirectURL) + "&response_type=code&scope=email"

    Step 2: Now you are on google signin page and you would enter your google credentials.

    Step 3 : Google will redirect you back to the redirect_uri that you have configured in the Google Developer Console and you can get the "code" from the QueryString

    Step 4: Now you post a form to https://www.googleapis.com/oauth2/v4/token with client_id, client_secret, redirect_uri, code(you obtained in Step 3), and the grant_type=authorization_code

    Result: You should now receive the access_token from Google


    我遵循Rajat的指示,他们的工作,但后来我尝试了OP再次做了什么,但这次把范围设置为“电子邮件”,而不是留空白,我得到一个提示输入我的gmail信用,并能够获得访问令牌。


    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

    链接地址: http://www.djcxy.com/p/80064.html

    上一篇: 从Google AppEngine服务器Java获取OAuth访问令牌

    下一篇: 无法在POSTMan上获得Google oAuth 2令牌