mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 03:18:23 -05:00
[GH-ISSUE #24094] issue: Feishu OAuth env var names mismatch between code and docs #58849
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 @tuzkiyoung on GitHub (Apr 24, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/24094
Check Existing Issues
Installation Method
Other
Open WebUI Version
0.9.2
Ollama Version (if applicable)
No response
Operating System
k8s
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
Setting the Feishu OAuth env variables exactly as documented at env-configuration#feishu — i.e.
FEISHU_CLIENT_ID,FEISHU_CLIENT_SECRET,FEISHU_CLIENT_SCOPE,FEISHU_CLIENT_REDIRECT_URI— should produce a working Feishu login flow, with theredirect_uriparameter sent toaccounts.feishu.cnmatching the configured value.
Actual Behavior
The code reads two of those variables under different names than the docs use:
FEISHU_CLIENT_REDIRECT_URIFEISHU_REDIRECT_URIFEISHU_CLIENT_SCOPEFEISHU_OAUTH_SCOPEFEISHU_CLIENT_IDFEISHU_CLIENT_ID✅FEISHU_CLIENT_SECRETFEISHU_CLIENT_SECRET✅Code refs (v0.9.2, also present on
main):Because users following the docs set
FEISHU_CLIENT_REDIRECT_URI, the value the code looks for (FEISHU_REDIRECT_URI) is empty. The Feishu provider is registered withredirect_uri='', and authlib falls back torequest.url_for(...)(utils/oauth.pyL1434).
When the reverse proxy in front of Open WebUI terminates TLS but does not forward
X-Forwarded-Proto: https(e.g. Aliyun ALB with the defaultXForwardedForProtoEnabled: falselistenerconfig),
request.url_for()produces anhttp://...URL. Feishu then rejects the callback as aredirect_urimismatch. The failure is silent from Open WebUI's side — no warning atstartup, no log entry pointing at the env var name.
The mismatch dates back to docs PR https://github.com/open-webui/docs/pull/685, which named the variables to follow the
*_CLIENT_*pattern used by Google/Microsoft/GitHub providers,while the code under
config.pyhad shipped with the shorterFEISHU_REDIRECT_URI/FEISHU_OAUTH_SCOPEnames. The related fix in PRshttps://github.com/open-webui/open-webui/pull/23129 / https://github.com/open-webui/open-webui/pull/23203 (resolving https://github.com/open-webui/open-webui/issues/23128) only takes
effect when the env var name matches what the code reads — which the docs currently get wrong.
Steps to Reproduce
X-Forwarded-Proto: https(e.g. Aliyun ALB with default listener config).https://<your-host>/oauth/feishu/loginand inspect the 302 response.Observed: the
Locationheader containsredirect_uri=http%3A%2F%2F<your-host>%2Foauth%2Ffeishu%2Fcallback(notehttp, nothttps), and Feishu rejects the callback.Workaround: rename the env var to
FEISHU_REDIRECT_URI(andFEISHU_OAUTH_SCOPEif used) to match what the code actually reads. Theredirect_urithen comes from the explicit valueand is unaffected by what the proxy forwards.
Logs & Screenshots
N/A
Additional Information
Option A — fix the docs (smallest change): rename
FEISHU_CLIENT_REDIRECT_URI→FEISHU_REDIRECT_URIandFEISHU_CLIENT_SCOPE→FEISHU_OAUTH_SCOPEon the env-configuration page.One PR to open-webui/docs.
Option B — fix the code (better consistency with sibling providers, but a behavior change): rename the env keys in
config.pytoFEISHU_CLIENT_REDIRECT_URI/FEISHU_CLIENT_SCOPEwhile keeping the old names as a fallback for one or two releases so existing deployments don't break:
Independent of A/B, it would help users a lot if
FEISHU_CLIENT_IDbeing set while the redirect URI env var is empty produced a startup warning, so the silent fallback tohttp://URLsdoesn't go unnoticed.
Happy to send a PR for whichever direction you prefer.
@Ansh1372 commented on GitHub (Apr 27, 2026):
Hi! I'm a first-time contributor and would love to work on this.
I'd like to go with Option A — fixing the docs to match what
the code actually reads (renaming FEISHU_CLIENT_REDIRECT_URI
→ FEISHU_REDIRECT_URI and FEISHU_CLIENT_SCOPE → FEISHU_OAUTH_SCOPE).
Could a maintainer confirm this is the preferred approach
before I open a PR? Thank you!