I know oauth2client
is deprecated but still, that's the one we use.
When I start the oauth2 process with Google, it always tries to redirect me to the HTTP version of my app.
I've seen the url_for
method of Flask is supposed to be based on the request context and when I start the process (i.e. calling the oauth2authorize
url), I am in HTTPS. So I don't understand why it passes a redirect_uri
in HTTP...
This is the code of Flask
flow = client.OAuth2WebServerFlow(
client_id=self.client_id,
client_secret=self.client_secret,
scope=scopes,
state=state,
redirect_uri=url_for('oauth2.callback', _external=True),
**kw)
My app runs in App Engine flexible, if that helps. And I also tried to set the PREFERRED_URL_SCHEME
of my Flask app to 'https'.
And in case that wasn't clear: I don't want the redirect_uri to be HTTP, my app is supposed to be HTTPS only ;-)