open-webui / open-webui/computer

bug: Trusted Header auth not working

Open
#166 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
569
Forks
79
PR merge metrics
No merged PRs in 30d

Description

I am unable to setup trusted header auth with computer. Already running fine with Open WebU, Authelia and Traefik.

After doing the initial setup, I modify config.toml with the following.

[auth]
mode = "trusted_header"
header = "Remote-User"
trusted_sources = ["172.16.2.2"]

The endpoint /api/auth always returns {"authenticated":false}.

Reviewing the code, I believe check_access needs to send remote_user_header https://github.com/open-webui/computer/blob/3b0e0f8dc384434a09d76bb9776e0511698eb2b4/cptr/routers/auth.py#L57

Though if that's added in then the following is returned AuthResult(user_id=None, username='<redacted>', role='user', exp=0) and it never enters the next block because user_id is None.

https://github.com/open-webui/computer/blob/3b0e0f8dc384434a09d76bb9776e0511698eb2b4/cptr/routers/auth.py#L59

Not sure what the correct fix is but that is my investigation so far.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in cptr/routers/auth.py around the check_access logic at the referenced lines, and reproduce the issue with the supplied config.toml trusted_header settings. Trace the /api/auth response through the remote-user header and AuthResult handling; done means a trusted request returns authenticated=true with a populated user identity.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, authentication, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.