google-apigoogle-oauthpermission-deniedoauth2-playground

Using OAuth2.0 Playground for testing


i wanted to test some API Requests from Proximity Beacon API. So i followed the steps from this site and put a test redirect url (https://developers.google.com/oauthplayground) into the OAuth-2.0-Client-ID. When i try to make an request from the playground i get following output:

{
  "error": {
    "status": "PERMISSION_DENIED", 
    "message": "Google Proximity Beacon API has not been used in project google.com:oauth-2-playground before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/proximitybeacon.googleapis.com/overview?project=google.com:oauth-2-playground then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.", 
    "code": 403, 
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.Help", 
        "links": [
          {
            "url": "https://console.developers.google.com/apis/api/proximitybeacon.googleapis.com/overview?project=google.com:oauth-2-playground", 
            "description": "Google developers console API activation"
          }
        ]
      }
    ]
  }
}

obviously it is using the wrong project, but i only got to a step where i was able to pick my account but not my project. i checked everything twice and my only guess is that i cannot use this redirect_url.

So my question: Why is it trying to use the project google.com:oauth-2-playground instead of mine? And how can i change this?


Solution

  • The Proximity Beacon API was not enabled on the default credentials that the OAuth 2.0 Playground uses. I've just enabled that API and now this should work.

    Alternatively you can setup the OAuth 2.0 Playground to use your own app's OAuth Credentials (Client ID and Client Secret) in the configuration menu of the playground.