[PR #21171] [CLOSED] feat: Allow customizing user info header names via environment variables #129614

Closed
opened 2026-05-21 13:07:33 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/21171
Author: @useradd-temp
Created: 2/5/2026
Status: Closed

Base: devHead: custom_user_info_header


📝 Commits (1)

  • 60c74f8 feat: Allow customizing user info header names via environment variables

📊 Changes

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

View changed files

📝 backend/open_webui/utils/headers.py (+5 -4)

📄 Description

Changelog Entry

Description

Support for customizing user information header names through environment variables, while maintaining backward compatibility with the default X-OpenWebUI-User-* headers. This allows deployments to use custom header names that fit their infrastructure requirements.

Motivation:
When integrating with existing infrastructure or reverse proxies, some deployments may need to use different header names to avoid conflicts or comply with internal standards. For instance, AWS Bedrock AgentCore only accepts headers prefixed with X-Amzn-Bedrock-AgentCore-Runtime-Custom-, making it impossible to forward user information with the hardcoded X-OpenWebUI-User-* headers. This change enables compatibility with such services while maintaining backward compatibility for existing deployments.

Added

  • Environment variable support for customizing user info header names:
    • FORWARD_USER_INFO_NAME - customize the user name header (default: X-OpenWebUI-User-Name)
    • FORWARD_USER_INFO_ID - customize the user ID header (default: X-OpenWebUI-User-Id)
    • FORWARD_USER_INFO_EMAIL - customize the user email header (default: X-OpenWebUI-User-Email)
    • FORWARD_USER_INFO_ROLE - customize the user role header (default: X-OpenWebUI-User-Role)

Changed

  • Modified include_user_info_headers() function to read header names from environment variables
  • Header names now use os.environ.get() with fallback to original default values

Deprecated

N/A

Removed

N/A

Fixed

N/A

Security

N/A

Breaking Changes

Fully backward compatible. If environment variables are not set, the original header names are used.


Additional Information

N/A

Screenshots or Videos

N/A

Contributor License Agreement

By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.

Note

Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in.


🔄 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/21171 **Author:** [@useradd-temp](https://github.com/useradd-temp) **Created:** 2/5/2026 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `custom_user_info_header` --- ### 📝 Commits (1) - [`60c74f8`](https://github.com/open-webui/open-webui/commit/60c74f832b02ab9b12676b92035009a93d1f4a52) feat: Allow customizing user info header names via environment variables ### 📊 Changes **1 file changed** (+5 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/utils/headers.py` (+5 -4) </details> ### 📄 Description # Changelog Entry ### Description Support for customizing user information header names through environment variables, while maintaining backward compatibility with the default `X-OpenWebUI-User-*` headers. This allows deployments to use custom header names that fit their infrastructure requirements. **Motivation:** When integrating with existing infrastructure or reverse proxies, some deployments may need to use different header names to avoid conflicts or comply with internal standards. For instance, AWS Bedrock AgentCore only accepts headers prefixed with `X-Amzn-Bedrock-AgentCore-Runtime-Custom-`, making it impossible to forward user information with the hardcoded `X-OpenWebUI-User-*` headers. This change enables compatibility with such services while maintaining backward compatibility for existing deployments. ### Added - Environment variable support for customizing user info header names: - `FORWARD_USER_INFO_NAME` - customize the user name header (default: `X-OpenWebUI-User-Name`) - `FORWARD_USER_INFO_ID` - customize the user ID header (default: `X-OpenWebUI-User-Id`) - `FORWARD_USER_INFO_EMAIL` - customize the user email header (default: `X-OpenWebUI-User-Email`) - `FORWARD_USER_INFO_ROLE` - customize the user role header (default: `X-OpenWebUI-User-Role`) ### Changed - Modified `include_user_info_headers()` function to read header names from environment variables - Header names now use `os.environ.get()` with fallback to original default values ### Deprecated N/A ### Removed N/A ### Fixed N/A ### Security N/A ### Breaking Changes Fully backward compatible. If environment variables are not set, the original header names are used. --- ### Additional Information N/A ### Screenshots or Videos N/A ### Contributor License Agreement By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. > [!NOTE] > Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in. --- <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 13:07:33 -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#129614