From 15306883650f6414faf6545d55508225328bf84b Mon Sep 17 00:00:00 2001 From: Harry Kodden Date: Mon, 30 Dec 2024 10:00:25 +0000 Subject: [PATCH] make RP aware of running behind ssl terminating front end proxy --- example/flask_rp/wsgi.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/example/flask_rp/wsgi.py b/example/flask_rp/wsgi.py index ff3f9dae..9e14e3cd 100755 --- a/example/flask_rp/wsgi.py +++ b/example/flask_rp/wsgi.py @@ -8,6 +8,8 @@ from idpyoidc.configure import create_from_config_file from idpyoidc.ssl_context import create_context +from werkzeug.middleware.proxy_fix import ProxyFix + try: from . import application except ImportError: @@ -25,6 +27,10 @@ filename=conf) app = application.oidc_provider_init_app(_config.rp, name, template_folder=template_dir) + + app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1, x_proto=1, x_host=1, x_port=1, x_prefix=1) + + _web_conf = _config.web_conf context = create_context(dir_path, _web_conf)