Using Flask session variable for OAUTH CSRF prevention
I am trying to write a simple (hah!) Python Flask app which will use Google’s people
API to retrieve a user’s numeric Google ID (which otherwise seems to be almost impossible to determine). Doing this requires that the user authenticate with Google’s OAUTH. I have this working, but Google’s Using OAuth 2.0 for Web Server Applications documentation says:
Google Sign-In “Permission denied to generate login hint for target domain” Error in Flask
Question:
Google OAuth fetching token for API use – Invalid Grant Error
I’m trying to use google’s calendar API and I’m so lost. I figured out how to get authentication the first time around, when I send the user to approve the access scope, but I can’t figure out how to get the credentials I need to perform any other actions once the session for that original authorization goes away. Here is all my code around connection to google.