Skip to content

Instantly share code, notes, and snippets.

@leeyspaul
Last active November 30, 2021 17:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leeyspaul/0ef4716e49cf011eb7fc872348ca81da to your computer and use it in GitHub Desktop.
Save leeyspaul/0ef4716e49cf011eb7fc872348ca81da to your computer and use it in GitHub Desktop.
OAuth2 Google Calendar API Authorize Route
# create our Flask web app
app = Flask(__name__)
# this allows transport over HTTP for development purposes, if excluded
# HTTPS is needed
os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1'
@app.route("/authorize-user")
def auth_user():
"""
Redirects a user to Google's authorization server to show the OAuth
Consent screen and get user consent.
"""
return redirect(authorization_url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment