mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 11:28:35 -05:00
[GH-ISSUE #21280] issue: SCIM externalId is ignored during User Creation and Updates #58095
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 @cyronis on GitHub (Feb 9, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/21280
Check Existing Issues
Installation Method
Git Clone
Open WebUI Version
0.7.2
Ollama Version (if applicable)
No response
Operating System
Ubuntu 22.04
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
When creating or updating a user via the SCIM 2.0 API, the externalId provided in the request payload should be persisted in the database. Subsequent GET requests to the user endpoint should return the stored externalId. This is critical for Identity Provider (IdP) synchronization (e.g., Microsoft Entra ID / Azure AD), which relies on this field to map external directory objects to internal users.
Actual Behavior
The externalId is ignored by the backend. Even if a valid string is sent in a POST or PATCH request, the API response returns "externalId": null. The user is created or updated successfully, but the link to the external identity is lost, causing "Provision on Demand" or synchronization cycles in IdPs to fail or report inconsistencies.
Steps to Reproduce
Using a tool like Bruno or curl, send a POST request to /api/v1/scim/v2/Users with the following payload:
JSON
{
"schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
"externalId": "my-unique-external-id",
"userName": "test.user@example.com",
"displayName": "Test User",
"name": { "givenName": "Test", "familyName": "User" },
"emails": [{ "value": "test.user@example.com", "primary": true }],
"active": true
}
Observe the HTTP 201 Created response.
Check the returned JSON: externalId is null instead of "my-unique-external-id".
Logs & Screenshots
Analysis of the source code (scim.py):
The issue is caused by a missing mapping in the SCIM router. While the Pydantic models (like SCIMUserCreateRequest) correctly include the externalId field, the actual database insertion logic does not:
Python
Current implementation in scim.py
new_user = Users.insert_new_user(
id=user_id,
name=name,
email=email,
profile_image_url=profile_image,
role="user" if user_data.active else "pending",
db=db,
# externalId is missing and therefore never saved to the DB
)
Additional Information
I am testing this using Microsoft Entra ID (Azure AD) Provisioning on Demand. The IdP expects the returned resource to reflect the externalId it just sent. Because OpenWebUI returns null, the synchronization state becomes unreliable.
Logs & Screenshots
N/A - Verified via API response and source code analysis
MICROSOFT_CLIENT_ID =
MICROSOFT_CLIENT_SECRET =
MICROSOFT_CLIENT_TENANT_ID =
MICROSOFT_REDIRECT_URI =
OPENID_PROVIDER_URL = https://login.microsoftonline.com/****/v2.0/.well-known/openid-configuration
OAUTH_SCOPE = openid email profile User.Read GroupMember.Read.All
OAUTH_EMAIL_CLAIM = email
ENABLE_OAUTH_ROLE_MANAGEMENT = true
OAUTH_ROLES_CLAIM = roles
ENABLE_OAUTH_GROUP_MANAGEMENT = true
ENABLE_OAUTH_GROUP_CREATION = true
OAUTH_GROUPS_CLAIM = groups
SCIM_ENABLED = TRUE
SCIM_TOKEN =
Additional Information
No response
@guenhter commented on GitHub (Feb 10, 2026):
Will hopefully be fixed by https://github.com/open-webui/open-webui/pull/21099
@tjbck commented on GitHub (Feb 13, 2026):
Should be addressed in dev, let us know if the issue persists!