mirror of
https://github.com/open-webui/open-webui.git
synced 2026-06-05 16:28:32 -05:00
[GH-ISSUE #18542] feat: Support OAUTH_*_ROLES that include a comma #57295
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?
Originally created by @attilaolah on GitHub (Oct 23, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/18542
Check Existing Issues
Problem Description
I am in the unfortunate position that my Identity Provider sets groups in the token using an LDAP-like syntax, so instead of something like
mygroup, I get values likecn=mygroup,ou=myunit,o=myorg.These cannot be used with
OAUTH_ALLOWED_ROLESorOAUTH_ADMIN_ROLESbecause the commas are used as a separator, so the value is treated as if I specified the parts as individual roles, see here:7a83e7dfa3/backend/open_webui/config.py (L579-L592)Desired Solution you'd like
Switching the separator to something else like a semicolon would work as a quick fix, but would be a breaking change, even worse, it would cause the same issue for the other unfortunate people who might have semicolons in the role names.
A simple thing that comes to mind would be to escape the comma with backslashes, but then you'd need to split them with a lookbehind, maybe with a regex.
Maybe a nicer approach would be to try to parse the env var as JSON, and only if that fails, treat it as a comma-separated list?
I'm happy to send a PR if you can advise what kind of solution would you be willing to accept.
Alternatives Considered
We have a workaround for now, which is to use another claim for the roles, but that is less than ideal.
Additional Context
No response