Why I can not authorize API for Google Drive?

I am trying to get my access token for my Google drive so I opened OAuth 2.0 Playground https://developers.google.com/oauthplayground/ then I open the configuration and entered client id and client secret then I select https://www.googleapis.com/auth/drive from "Drive API v3" then clicked authorize APIs but I get redirected to blank page with error:

  1. That’s an error. Error: redirect_uri_mismatch

why is that ?

enter image description here

1 answer

  • answered 2018-02-13 02:25 Tanaike

    When you create the credential for using OAuth 2.0 Playground, please include https://developers.google.com/oauthplayground to the redirect uri. The flow is as follows.

    • At Credentials : https://console.cloud.google.com/apis/credentials?project=### project ID ###
      • Click "Create credentials".
      • Select "OAuth client ID".
      • Select "Web application".
      • At "Authorized redirect URIs", please input https://developers.google.com/oauthplayground.
        • This is used as the redirect uri.
      • Click "Create" and click "Create".
      • Copy Client ID and Client Secret.

    Note :

    • After you input client id and client secret to the configuration, when you click "Authorize APIs" at OAuth 2.0 Playground, the authorization screen is displayed. When you authorize it, you can go to the next step.
      • If HTTP/1.1 302 Found is displayed, please click "Exchange authorization code for tokens.". By this, you can retrieve the access token and refresh token.

    If I misunderstand your question, I'm sorry.