[PR #22412] [CLOSED] fix: URL-encode OAuth error message in redirect URL #130326

Closed
opened 2026-05-21 14:19:54 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/22412
Author: @gambletan
Created: 3/8/2026
Status: Closed

Base: devHead: fix/oauth-error-url-encode


📝 Commits (1)

  • 8e81e9d fix: URL-encode OAuth error message in redirect URL

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 backend/open_webui/utils/oauth.py (+1 -1)

📄 Description

Summary

  • URL-encodes the OAuth error message when constructing the redirect URL in the OIDC callback handler (backend/open_webui/utils/oauth.py, line 1709)
  • Without encoding, error messages containing spaces, ampersands, or other special characters produce malformed URLs that the frontend cannot parse correctly
  • The custom OAuth client callback handler (line 938) already correctly uses urllib.parse.quote_plus() for the same purpose; this fix brings the OIDC handler in line with that pattern

Test plan

  • Trigger an OAuth error (e.g., invalid credentials) and verify the redirect URL is properly encoded
  • Verify the frontend correctly displays the error message after redirect
  • Verify normal OAuth login flow still works without errors

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/22412 **Author:** [@gambletan](https://github.com/gambletan) **Created:** 3/8/2026 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `fix/oauth-error-url-encode` --- ### 📝 Commits (1) - [`8e81e9d`](https://github.com/open-webui/open-webui/commit/8e81e9dd030187c65e5fd12b86a2cbd696e8ff47) fix: URL-encode OAuth error message in redirect URL ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/utils/oauth.py` (+1 -1) </details> ### 📄 Description ## Summary - URL-encodes the OAuth error message when constructing the redirect URL in the OIDC callback handler (`backend/open_webui/utils/oauth.py`, line 1709) - Without encoding, error messages containing spaces, ampersands, or other special characters produce malformed URLs that the frontend cannot parse correctly - The custom OAuth client callback handler (line 938) already correctly uses `urllib.parse.quote_plus()` for the same purpose; this fix brings the OIDC handler in line with that pattern ## Test plan - [ ] Trigger an OAuth error (e.g., invalid credentials) and verify the redirect URL is properly encoded - [ ] Verify the frontend correctly displays the error message after redirect - [ ] Verify normal OAuth login flow still works without errors --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-21 14:19:54 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#130326