Should Callback respect X-Forwarded-Prefix headers from reverse proxy?
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 38/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Ambito
- authentication, backend, infrastructure
Direzione di ricerca
Inizia in dash_auth/oidc_auth.py, alla return statement collegata intorno alla riga 277, poi esamina come il ProxyFix configurato gestisce X-Forwarded-Prefix. Riproduci il redirect con la configurazione fornita di location e header di nginx. Il lavoro è completato quando il redirect finale preserva /my-app1 quando il reverse proxy fornisce quel prefisso, senza compromettere il fallback del base-path configurato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Could totally be my own inexperience here, but I'm running into redirect issues from my IDP and I think it's because of this line.
My nginx config has an app running on http://127.0.0.1:8050 being accessed through location /my-app1/. So I pass a proxy_set_header X-Forwarded-Prefix /my-app1.
All the auth stuff works out, however the final redirect pushes me to <my-domain> instead of <my-domain>/my-app1 like I would expect. I believe this is because I am not setting url_base_pathname in Dash to be /my-app1/, rather I am only setting requests_pathname_prefix to that value. The reason there being ... unclear .. but I find things only work when setting requests_pathname_prefix vs url_base_pathname
I'm also using a ProxyFix, which is forwarding on that Prefix header, but I am not familiar enough with Flask internals to know where / when it is applied (if at all).
app.server.wsgi_app = ProxyFix( app.server.wsgi_app, x_for=1, x_proto=1, x_host=1, x_prefix=1 )
Either way, if I patch
return redirect(self.app.config.get("url_base_pathname") or "/")
to effectively be
return redirect(request.headers.get("X-Forwarded-Prefix") or self.app.config.get("url_base_pathname") or "/")
Everything appears to redirect as intended. So I'm wondering if that header needs to be captured in this return statement.
It's no doubt a bit confusing when you have nginx waitress flask and dash all in line trying to be helpful!
- Lingua principale
- Python
- Stelle
- 135
- Fork
- 67
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di plotly/dash-auth
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 28/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 55/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
Tutte le issue di plotly/dash-auth
Issue simili
-
link-check link-check:sphinx-theme
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
qgis/QGIS-Documentation#11275 ·
-
bug priority:normal ready-for-dev
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
OpenHands/extensions#626 · 1 commento ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
CSCfi/sd-search-api#39 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100