authlib / authlib/auth-playground
Add support for running behind a reverse proxy
- Dominant language
- Python
- Stars
- 2
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
I deployed this behind a load balancer, configured with TLS, etc, etc. An issue I found when logging in was the app specifies the wrong scheme in the `redirect_uri=http` when calling the IdPs `/authorize` endpoint.
One solution would be to modify the `url_for`s in `src/auth_playground/oauth.py` to set `_scheme="https"`. A potential other alternative would be to use the [ProxyFix](https://werkzeug.palletsprojects.com/en/stable/middleware/proxy_fix/#werkzeug.middleware.proxy_fix.ProxyFix) middleware.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in src/auth_playground/oauth.py and trace the url_for calls that build the IdP /authorize redirect_uri. Compare setting _scheme="https" with adding Werkzeug ProxyFix, using the linked ProxyFix documentation as guidance. Done means the redirect_uri uses https when the app runs behind a TLS-terminating load balancer.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- authentication
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100