singingwolfboy / flask-dance

Doing the OAuth dance with style using Flask, requests, and oauthlib.
https://pypi.python.org/pypi/Flask-Dance/
MIT License
1.01k stars 158 forks source link

google example totally old and wrong. #437

Open antoniocaruso opened 3 months ago

antoniocaruso commented 3 months ago

The google api changed the endpoint that can be used with oauth, the endpoint in the example the line: resp = google.get("/plus/v1/people/me") return an error with:

AssertionError: {
  "error": {
    "code": 403,
    "message": "Legacy People API has not been used in project 53479404417 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/legacypeople.googleapis.com/overview?project=53479404417 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
    "status": "PERMISSION_DENIED",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.Help",
        "links": [
          {
            "description": "Google developers console API activation",
            "url": "https://console.developers.google.com/apis/api/legacypeople.googleapis.com/overview?project=53479404417"
          }
        ]
      },
      {
        "@type": "type.googleapis.com/google.rpc.ErrorInfo",
        "reason": "SERVICE_DISABLED",
        "domain": "googleapis.com",
        "metadata": {
          "service": "legacypeople.googleapis.com",
          "consumer": "projects/53479404417"
        }
      }
    ]
  }

I'm trying to understand the correct endpoint, but it seems that google have changed them, and it is really difficult for beginners to figure out how to fix it. Please, could you check for the specific case of GOOGLE auth, a simple COMPLETE example, and maybe give a repository that is just working ? (by just writing the correct client_id,client_secret). I've followed the example with git, and it works, but out there the majority of users have a google account, so please I think that a simple code that works with google auth, is really really really important for beginners. I'm trying to do it in the last week, without ANY success.