[PR #18646] [CLOSED] fix(auth): Decode trusted name header to support non-ASCII usernames #11662

Closed
opened 2025-11-11 19:38:01 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/18646
Author: @JungJunYong
Created: 10/27/2025
Status: Closed

Base: devHead: fix-auth-decode


📝 Commits (1)

  • 83fef0c fix(auth): Decode trusted name header to support non-ASCII usernames

📊 Changes

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

View changed files

📝 backend/open_webui/routers/auths.py (+9 -1)

📄 Description

Description

This PR fixes an issue where usernames containing non-ASCII characters (e.g., Korean, Japanese, Cyrillic) were displayed incorrectly during trusted header authentication.

The name would appear as a raw URL-encoded string (like %ED%99%8D...) instead of the actual characters (e.g., 홍길동).

How it was fixed

The problem occurred because the backend was reading the WEBUI_AUTH_TRUSTED_NAME_HEADER value directly without decoding it.

This fix introduces urllib.parse.unquote to the sign-in logic. This correctly decodes the header value, converting any URL-encoded sequences back into their original characters before assigning the name to the user.

This ensures usernames in all languages are displayed correctly while still allowing for safe transport of non-ASCII characters in HTTP headers.

contributor license agreement


🔄 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/18646 **Author:** [@JungJunYong](https://github.com/JungJunYong) **Created:** 10/27/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `fix-auth-decode` --- ### 📝 Commits (1) - [`83fef0c`](https://github.com/open-webui/open-webui/commit/83fef0cb44fd440ca19106b836720dbbc10bc972) fix(auth): Decode trusted name header to support non-ASCII usernames ### 📊 Changes **1 file changed** (+9 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/routers/auths.py` (+9 -1) </details> ### 📄 Description ## Description This PR fixes an issue where usernames containing non-ASCII characters (e.g., Korean, Japanese, Cyrillic) were displayed incorrectly during trusted header authentication. The name would appear as a raw URL-encoded string (like `%ED%99%8D...`) instead of the actual characters (e.g., `홍길동`). ## How it was fixed The problem occurred because the backend was reading the `WEBUI_AUTH_TRUSTED_NAME_HEADER` value directly without decoding it. This fix introduces `urllib.parse.unquote` to the sign-in logic. This correctly decodes the header value, converting any URL-encoded sequences back into their original characters before assigning the name to the user. This ensures usernames in all languages are displayed correctly while still allowing for safe transport of non-ASCII characters in HTTP headers. contributor license agreement --- <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 2025-11-11 19:38:01 -06: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#11662