mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[PR #23093] [CLOSED] fix: refresh forwarded system oauth id token for OpenAI proxy #42652
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?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/23093
Author: @raashish1601
Created: 3/26/2026
Status: ❌ Closed
Base:
dev← Head:fix/refresh-system-oauth-id-token📝 Commits (1)
3ae0c73fix: refresh forwarded system oauth id token📊 Changes
2 files changed (+77 additions, -2 deletions)
View changed files
📝
backend/open_webui/routers/openai.py(+8 -2)➕
backend/open_webui/test/apps/webui/routers/test_openai.py(+69 -0)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions to discuss your idea/fix with the community before creating a pull request, and describe your changes before submitting a pull request.
This is to ensure large feature PRs are discussed with the community first, before starting work on it. If the community does not want this feature or it is not relevant for Open WebUI as a project, it can be identified in the discussion before working on the feature and submitting the PR.
Before submitting, make sure you've checked the following:
devbranch. PRs targetingmainwill be immediately closed.devto ensure no unrelated commits (e.g. frommain) are included. Push updates to the existing PR branch instead of closing and reopening.Changelog Entry
Description
oauth_id_tokencookie duringsystem_oauthOpenAI proxy requests so custom Responses backends receive the current token instead of a stale browser cookie.Added
get_headers_and_cookiescovering refreshed and missingid_tokencases.Changed
get_headers_and_cookiesnow clones forwarded cookies forsystem_oauthrequests and replacesoauth_id_tokenwith the latest token from the OAuth session when available.Deprecated
Removed
Fixed
oauth_id_tokencookie now receive the refreshed token during/responsesand other OpenAI proxy requests.id_token.Security
Breaking Changes
Additional Information
system_oauthbehavior without introducing new settings or APIs.python -m uv run --group dev pytest backend/open_webui/test/apps/webui/routers/test_openai.pypython -m uv run --group dev ruff check backend/open_webui/test/apps/webui/routers/test_openai.pyScreenshots or Videos
Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.