Closed royberkoweee closed 3 years ago
The protocol of the generated URL is based on whether Flask believes the connection to be http or https.
It’s usually a setup/configuration issue with your reverse proxy if it doesn’t generate an https URL when you’re expecting one.
The usual issue is you’re not setting X-Forwarded-Proto when proxying: https://flask.palletsprojects.com/en/1.1.x/deploying/wsgi-standalone/#proxy-setups
Thanks
app.wsgi_app = ProxyFix(app.wsgi_app, x_proto=1, x_host=1)
solved it indeed
Hey,
I am wondering why redirect_uri uses an HTTP scheme by default instead of HTTPS. Can't find a good way to override it. This happens although I have the following setup:
app.config['PREFERRED_URL_SCHEME'] = 'https'
app.register_blueprint(google_blueprint, url_prefix='/login', url_scheme='https')
in OAuth2ConsumerBlueprint classe's login method:
self.session.redirect_uri = url_for(".authorized", _external=True)
Should be:
self.session.redirect_uri = url_for(".authorized", _external=True, **_scheme='https'**)
Is there a way to override this (a.k.a make the redirect_uri scheme use HTTPS) during the blueprint initiation?