Skip to content

Instantly share code, notes, and snippets.

@ricardochaves
Created February 2, 2019 17:30
Show Gist options
  • Save ricardochaves/2b9cc37b10d4e80bc12ff394c7f39173 to your computer and use it in GitHub Desktop.
Save ricardochaves/2b9cc37b10d4e80bc12ff394c7f39173 to your computer and use it in GitHub Desktop.
@app.route("/login")
def login():
auth_state = str(uuid.uuid4())
flask.session["state"] = auth_state
authorization_url = TEMPLATE_AUTHZ_URL.format(
config.TENANT, config.CLIENT_ID, REDIRECT_URI, auth_state, config.RESOURCE
)
resp = flask.Response(status=307)
resp.headers["location"] = authorization_url
return resp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment