mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-08 04:16:03 -05:00
[GH-ISSUE #7587] Google SSO does not work properly in a reverse proxy environment #14806
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Taikono-Himazin on GitHub (Dec 4, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/7587
Bug Report
Installation Method
docker
Use nginx as reverse proxy to support SSL
Environment
Open WebUI Version: v0.4.7
Ollama (if applicable): 0.4.7
Operating System: Win 11
Browser (if applicable): Chrome 131.0.6778.86
Confirmation:
Expected Behavior:
I have configured Google SSO.
I can sign in successfully.
Actual Behavior:
①OpenWebUI login screen
②Click "Sign in with Google" to go to the Google screen
③Authentication with Google is successful, and you are returned to the URL set in GOOGLE_REDIRECT_URI.
④Bug here You are redirected to the URL after reverse proxy.
⑤Since you cannot access it from the client PC, an error occurs naturally
URL flow
①
https://[front URL]:3443/auth
②https://accounts.google.com/o/oauth2/v2/auth?response_type=code&client_id=XXXXXXX&redirect_uri=https%3A%2F%2F[front URL]%3A3443%2Foauth%2Fgoogle%2Fcallback&scope=openid+email+profile&state=XXX XXX
③
https://[URL on the front side]:3443/oauth/google/callback?state=XXXXXX&code=XXXXXX&scope=email+profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile+openid&authuser=0&hd=XXXX&prompt=none
④Bug here https://[URL on the back side]/auth
Description
I'm running OpenWebUI behind a reverse proxy.
WebUI_URL and GOOGLE_REDIRECT_URI are set correctly as the URL on the front side.
A. The redirect destination in ④ is wrong. It should be set based on WebUI_URL, not fastapi.baseurl.