Open WebUI organization rollout with per-user JWT auth in LiteLLM

Open WebUI can forward each employee's IdP access token to LiteLLM, which validates it as a JWT so spend, model access and budgets follow group membership without shared keys. This page covers the build, its prerequisites and where rollouts fail.

On this page

Open WebUI organization rollout with per-user JWT auth in LiteLLM explained

An organization that wants one governed chat workspace for employees should not hand out a shared LiteLLM key to a web front end. In the pattern LiteLLM documents for Open WebUI organization rollouts, Open WebUI signs each user in through the identity provider and forwards that user's access token, and LiteLLM validates the token as a JWT so every request is attributed to the person, their team and the organization. Model access and budgets then follow IdP group membership, so the gateway, not the chat front end, decides what each employee can reach and spend. This is LiteLLM's documented Open WebUI organization pattern, and it has a licensing consequence: JWT authentication requires LITELLM_LICENSE, so budget for an Enterprise license before the design is final. The tested combination in LiteLLM's write-up was Open WebUI v0.12.0, Keycloak 26.4 and LiteLLM v1.105.0. Treat those as the reference point for a pilot, and confirm with the vendors whether your target versions behave the same way.

The decisions that matter most come before installation. Confirm that your IdP issues access tokens with the claims LiteLLM needs to map users to teams and organizations, and that group membership appears in those tokens. Decide which IdP groups map to which teams, which models each team may call, and which budgets apply, because these mappings become the access model for the whole workspace. Also confirm that Open WebUI can forward the access token it received at sign-in, since the design depends on LiteLLM seeing the person's identity rather than a service identity. Open WebUI's own SSO over OIDC and its SCIM 2.0 provisioning are useful for the front-end login, but they do not replace the token validation LiteLLM performs.

Plan the rollout as a test you can repeat. Use a small pilot group with two or three IdP groups that have different model access, then confirm three things: a user in each group reaches only the models their team permits, spend lands on the correct user and team, and a user removed from a group loses access after their token expires or is refreshed. Check the logs for the person's identity on every request. Keep the LITELLM_MASTER_KEY out of the chat front end entirely, store it in a secret manager, and record the exact Open WebUI, IdP and LiteLLM versions you tested so an upgrade can be re-verified against the same checks. Ask your implementation partner or internal team to confirm the claim mapping and token lifetimes against your own IdP configuration before any staff use the workspace.

What you need in place before the rollout starts

The rollout ties four components together: a LiteLLM proxy that validates tokens, an identity provider that issues them with group claims, Open WebUI as the chat front end, and a license that enables JWT authentication. Confirm each one, and the exact versions you deploy, before you configure anything, because the tested combination is specific.

LiteLLM proxy with PostgreSQL

The LiteLLM proxy validates each user's JWT, attributes requests to a person, team and organization, and enforces budgets and model access. Virtual keys and per-user budgets need a PostgreSQL database, so provision it before the proxy. Once more than one proxy instance runs, add Redis 7.0 or newer for shared rate limits and router state. Check that LITELLM_MASTER_KEY starts with sk- and sits in a secret manager.

Production guide

Identity provider issuing group claims

Keycloak or another OIDC provider must issue access tokens that carry group membership, because LiteLLM maps teams, model access and budgets from those groups. Confirm that the token audience, issuer and signing keys match what the proxy is configured to accept, and that group claims appear in the access token itself, not only in the ID token. Test with one real user before inviting the organization.

Keycloak docs

Open WebUI with PostgreSQL

Open WebUI uses the IdP for sign-in and forwards each user's access token to LiteLLM. For more than one replica, the scaling guide requires PostgreSQL instead of SQLite, because SQLite does not handle concurrent writes from multiple processes well. Confirm the database is in place and that the Open WebUI version you deploy matches the version you intend to test.

Scaling guide

Shared state and storage for replicas

Running several Open WebUI replicas also needs Redis for sessions, websocket connections and application state, plus shared file storage so uploads and knowledge stay reachable from every replica. Decide these before go-live, since moving uploads between storage backends later is disruptive. Test a file uploaded through one replica from another replica.

LITELLM_LICENSE for JWT authentication

JWT authentication for identity provider tokens requires a LITELLM_LICENSE. Confirm this with your LiteLLM account contact before design work starts, because the feature is not available on the open source configuration alone. Record which license covers which environment so that the audit trail for access control is complete.

Open WebUI license above 50 users

Open WebUI code from v0.6.6 onward is distributed under the Open WebUI License. It forbids altering or removing Open WebUI branding in deployments that exceed 50 users in any rolling 30-day period, unless you hold an enterprise license or written contributor permission. Count active users against that threshold during planning, and ask Open WebUI enterprise sales for a quote if you will exceed it.

Open WebUI License

Confirm versions against the tested set

The reference setup was tested with Open WebUI v0.12.0, Keycloak 26.4 and LiteLLM v1.105.0. Newer releases exist, so confirm each version you plan to deploy against that tested set and record any differences. Check the LiteLLM release notes and the Keycloak upgrade guidance before you pin versions, and test the full sign-in and budget path on your exact combination.

LiteLLM releases

How to configure Open WebUI and LiteLLM for per-user JWT auth

This sequence connects your identity provider, LiteLLM and Open WebUI so each employee signs in once, their token carries their group membership, and every request is attributed to that person and team with no shared keys.

  1. Configure the IdP realm, clients and group claims

    Your identity team creates a realm or equivalent tenant for workforce users, registers one OIDC client for Open WebUI sign-in and makes sure the access token includes a groups claim that lists each user's team memberships. Keycloak 26.4 was the version LiteLLM tested end to end, so confirm your version's behavior with its documentation before you rely on it. Decode a token from a test user and confirm the groups claim lists the expected team and that the audience value matches what LiteLLM will validate.

  2. Set LiteLLM JWT auth settings and the license

    The platform team adds the JWT authentication settings to the LiteLLM proxy configuration, pointing it at the IdP's JWKS endpoint, the expected issuer and audience, and the claim that carries group membership. JWT authentication requires a LITELLM_LICENSE value, which the team loads from the secret manager rather than the config file. Restart the proxy and confirm it starts cleanly and rejects a request that has no token or a token with the wrong audience.

  3. Map IdP groups to LiteLLM teams and model access

    Create one LiteLLM team for each IdP group that should have governed access, then restrict each team to the model names it may call. Confirm that the group names in LiteLLM match the group claim values exactly, including case. Send a request with a token from a user in one group to a model outside that team's list and confirm it is refused, then send the same request to an allowed model and confirm it succeeds.

  4. Configure Open WebUI OIDC sign-in and token forwarding

    The Open WebUI administrator enables OIDC sign-in against the same IdP client, points Open WebUI's model connection at the LiteLLM base URL, and configures it to forward the signed-in user's access token to LiteLLM instead of a shared key. Open WebUI's documentation describes its SSO and OIDC options, so check the exact setting names for your release. Sign in as one user, send a chat message and confirm the LiteLLM request log shows that user's identity, not a service account.

  5. Set budgets and per-user limits

    Set spend budgets at the team level and, where your policy requires it, per user, using the budget and rate limit options in LiteLLM's virtual keys model. Decide in advance how an exhausted budget should behave for an active chat, and confirm the message users see. Confirm the limits by sending requests until a test user reaches a deliberately low budget and checking that the next request is refused while a second user in the same team is unaffected.

  6. Verify attribution with two users

    Sign in to Open WebUI as two test users from different teams and send one message from each. Check the LiteLLM logs and spend records and confirm each request is attributed to the correct user, team and organization, and that no request appears under a shared key. Remove one test user from its group in the IdP, wait for a fresh token, and confirm that user loses access to that team's models. This closes the rollout and gives you the evidence your security team will ask for.

How IdP groups map to teams, models and budgets

LiteLLM reads the access token that Open WebUI forwards and validates its signature against the identity provider's keys. The claims in that token decide who the request belongs to. The person's identity claim is what attributes spend and logs to an individual, and the group or team claim decides which LiteLLM team the request is counted under. Confirm in the LiteLLM JWT documentation for your release which claim names are read by default and which settings change them, because the names are configurable and the defaults can differ between releases.

  • Subject or user claim: Pick a stable, unique claim such as the subject identifier or a verified email, and confirm the release can create the user record on first sight.
  • Group claim: Map the IdP group names that represent teams, and agree on a naming convention so that group names match LiteLLM team identifiers.
  • Organization claim: Decide whether one organization covers the whole company or whether separate business units need their own organization.
  • Unmapped groups: Decide what happens to a token with no recognized group. The safe default is no model access until an administrator maps the person.
  • Audience and issuer checks: Restrict the accepted issuer and audience so that tokens issued for other applications in the same realm are rejected.

Before go-live, sign in with a test account from each group, send one request, and confirm the request appears under the expected user and team in the LiteLLM logs.

Which token claims and LiteLLM fields carry identity

This table maps the identity fields an IdP issues in each user's access token to the LiteLLM user, team, organization and model access they drive. Read each row as a question to answer in your own configuration: which claim arrives, which LiteLLM field it populates, and what changes for the user when that claim changes. Any claim name shown is a placeholder to confirm in your IdP and in the LiteLLM JWT auth documentation, not a fixed name.

IdP fieldLiteLLM field it drivesWhat changes for the person
Subject (sub)Individual user identity used to attribute requests to one personEach request is logged against that person, not a shared key. Confirm which claim LiteLLM reads as the user ID in your version.
Email claim (confirm name in your IdP)User email and user record created or matched on first request, if automatic user creation is enabledSpend and logs display a recognizable name. Confirm the claim name and whether it is required for user creation.
Group claim (confirm name and format in your IdP)Team membership, which sets the team budget, allowed models and rate limitsAdding someone to an IdP group grants the team's model access. Removing them revokes it on the next token issued.
Organization or tenant identifier (confirm claim, if your IdP emits one)Organization grouping used for organization-level budgets and RBACSeparates users across business units or tenants. Confirm whether your LiteLLM edition exposes this mapping before you rely on it.
Audience (aud) and issuer (iss)Validation settings that decide whether a token is accepted at allTokens minted for another application are rejected. A mismatch here looks like a failed login, so check it first.
Token expiry (exp)Session lifetime seen by the gateway on each requestUsers with expired tokens must re-authenticate through Open WebUI. Align IdP lifetimes with your session policy.

Hardening the sign-in path and the gateway

The sign-in path runs from the browser through Open WebUI, Keycloak and LiteLLM, so a weak link at any one hop exposes model access and spend. The cards below cover the controls that connect those hops, from identity policy and secrets to the update process for the identity provider.

Enforce MFA at the identity provider

Open WebUI and LiteLLM trust the access token that Keycloak issues, so the strength of sign-in is decided at the IdP. Require multi-factor authentication for the realm or client that Open WebUI uses, not only for administrators. Confirm in a test login that the MFA step cannot be skipped by a second browser session or a legacy flow. Open WebUI also offers authenticator-app MFA, but for SSO users the IdP policy is the control that matters.

Keycloak admin docs

Store the master key in a secret manager

LITELLM_MASTER_KEY must start with sk- and grants administrative control over the gateway, so it should never sit in a values file, image or chat log. LiteLLM recommends keeping it in a secret manager and injecting it at runtime. Restrict who can read that secret, rotate it on a set schedule and on any staff change, and check that the proxy logs do not echo it.

LiteLLM production guide

Restrict Open WebUI keys and OIDC secrets

Two credentials in this design can grant access outside the IdP: Open WebUI API keys that users create for scripts, and the OIDC client secret that Open WebUI uses to talk to Keycloak. Decide whether API keys are allowed at all for each group, and limit them to the groups that need them. Store the client secret in a secret manager, give it a rotation owner, and confirm that a revoked user cannot keep calling the API with an old key.

Limit group access to specific models

Model access should follow IdP group membership, so the mapping between Keycloak groups and LiteLLM teams is a security control. Map each group to the models it may call, and keep high-cost or sensitive models in separate groups. Test with one account per group that a user outside the group receives a refusal for a model they can see in the picker. Review the mapping whenever a team changes, because stale group membership is the most common source of over-access.

LiteLLM virtual keys docs

Hold Keycloak Operator updates for approval

If you run Keycloak on Kubernetes through the Operator, the Operator documentation strongly recommends manual approval mode for updates, so a new version does not roll out without a change review. Pair each approved update with the Keycloak upgrading guide, and read the release notes for any change that affects realm settings, token claims or the database schema. Schema migration runs at startup by default, so plan a staged run or manual migration for larger deployments.

Keycloak Operator install

Confirm Enterprise controls for the edition

Audit logs, IP allowlisting, organization and team RBAC and secret manager integrations are Enterprise features in LiteLLM, and the SSO free tier has a user limit. Do not assume any of these are active in an open-source deployment. Ask the vendor which features your license covers, test each one in staging, and record the result in your control evidence. Where a control is not available in your edition, document the compensating step, such as network restriction at the load balancer.

LiteLLM Enterprise docs

How a chat request carries the employee's identity to LiteLLM

The request starts in the employee's browser, which signs in through Keycloak and receives an access token carrying group claims. Open WebUI forwards that token on every model call, and LiteLLM validates it as a JWT before it maps the user to a team, model access and budget in PostgreSQL. Only the LiteLLM proxy crosses the trust boundary to the model providers, so check that no shared key reaches Open WebUI and that the group-to-team mapping matches your IdP.

Shows the employee's token moving from sign-in through LiteLLM to the model provider.

How to test that identity, limits and logs behave before launch

How do I confirm a user in a restricted group sees only approved models?

Sign in as a test user from a restricted IdP group, open the model list in Open WebUI, and confirm that only the models mapped to that group appear. Then send a direct API request with that user's token for a model outside the group and confirm LiteLLM rejects it. Keep three pieces of evidence: the group-to-model mapping from your configuration, a screenshot or export of the visible model list, and the rejected request with its error response. Repeat the test for at least one user in each group that has different model access, because a mapping that works for one group can still leak models to another.

How do I check that spend lands on the right user and team?

Make a known number of requests as a test user in a specific team, then compare the spend recorded in LiteLLM against the usage the provider reports for the same calls. The record should show the individual user, the team and the organization on each request. Keep the test prompts, the timestamps, the spend records exported from the LiteLLM database or admin UI, and the provider usage figures for the same window. Differences between the two will usually come from token counting, cached tokens or model price settings, so confirm the price table for each model before you rely on the numbers for chargeback.

How do I verify that a user over budget is blocked?

Set a deliberately low budget on a test user or team, then send requests until the limit is reached and confirm that the next request is refused with a budget error rather than served. Repeat the check at the team level, because a per-user budget and a team budget can both apply and the stricter one should win. Keep the budget settings, the request that was blocked and its response, and the database record showing the spend total at the moment of the block. Also test the temporary budget increase path if your process allows one, and confirm that the increase expires as intended.

Does removing a user from a group revoke access on the next token?

Remove a test user from the IdP group, then wait for the next token issued by the IdP and confirm that LiteLLM no longer grants the old model access or team membership. Check how long an existing session in Open WebUI keeps working, because a session may outlast the access token unless you shorten token lifetimes or force a new sign-in. Keep the IdP audit event for the group change, the token claims before and after the change, and the failed request that shows the revoked access. Ask your identity team to confirm the access token lifetime in the IdP, since that setting controls the practical revocation window.

How do I confirm that logs carry the person's identity?

Send requests as two or three different test users, then find each request in your log store and confirm it names the individual user, team and organization that the JWT claims established. Check that the identity came from the validated token and not from a shared key or a default user, because a shared key would hide who made the call. Keep a sample of log lines for each test user, the matching request IDs, and the record of which claim fields LiteLLM used for user and team mapping. Also confirm that prompt content is logged or excluded according to your data handling policy, and test that a log export contains the same identity fields.

Who should run these tests, and what does a partner add?

Your own platform or security team can run these checks if they have test accounts in each IdP group, admin access to LiteLLM and Open WebUI, and access to the log store and provider usage reports. A partner typically adds an independent scope, a written test plan that maps each check to a requirement, and a retest after fixes. The cost depends on how many groups, models, teams and log destinations you have, and on how many fix cycles you expect, so ask for a quote built from that written scope. The test evidence remains yours, and an independent auditor will still decide whether your controls meet any compliance framework you are assessed against.

What should I keep as evidence for a launch review?

Keep one dated test record per check, with the configuration version under test, the test account used, the exact request or action, the observed result and the log or database evidence. Store the records in a location your compliance team can access, and tie each record to the release of Open WebUI, LiteLLM and Keycloak that was tested. Re-run the full set after any upgrade of those components, after changes to group mappings or budgets, and after changes to log destinations. Confirm the retention period for these records with your compliance team, since it depends on your own policy.

Why Open WebUI users get 401s or wrong team attribution

This table lists the failures most often seen when Open WebUI forwards IdP access tokens to LiteLLM, with the likely cause and a check to confirm the fix. Read it top to bottom during pilot testing, because token and identity problems usually show up as 401 errors and misattributed spend before anyone notices the wrong team. Each fix ends with something you can verify in your own environment before opening the workspace to all staff.

FailureLikely causeFix to verify
401 on every requestToken audience or issuer does not match what LiteLLM expectsDecode a test access token and compare its iss and aud with the issuer and audience configured in LiteLLM. Align the IdP client and LiteLLM settings, then repeat a test request.
401 for some users onlyToken is missing the group or team claim LiteLLM maps to teamsInspect tokens for a user in each group. Add the group claim to the access token in the IdP, not only the ID token, and confirm the claim name matches the LiteLLM JWT mapping.
Users land in the default team or no teamGroup claim exists but group names or IDs differ from the team mappingCompare the exact claim values with the team identifiers in LiteLLM. Fix naming in one place, then confirm a user in each group is attributed to the expected team in spend logs.
Authentication fails after a LiteLLM upgrade or config changeJWT auth attempted without a valid LITELLM_LICENSEConfirm the license variable is set in the running container or pod, not only in a config file. Check proxy startup logs for license errors before testing users.
Spend shows under one shared identityOpen WebUI still configured with a shared LiteLLM key instead of forwarding each user's tokenReview Open WebUI connection settings and remove the shared key from every connection and environment variable. Send one test request as two users and confirm two distinct identities appear in logs.
Intermittent 401s or inconsistent sessions across pagesMultiple Open WebUI replicas without Redis or shared file storageConfirm Redis and PostgreSQL are in use as the scaling guide describes, and that all replicas point to the same stores. Test by logging in once and refreshing repeatedly through the load balancer.
Tokens rejected as not yet valid or expired earlyClock skew between the IdP, LiteLLM and Open WebUI hostsCompare system time on each host against a common time source. Correct drift, then confirm tokens issued by the IdP validate immediately after issue.
Requests fail partway through long chat sessionsAccess token expires during a long session and is not refreshedCheck the access token lifetime in the IdP and how Open WebUI refreshes it. Run a session longer than the token lifetime and confirm requests continue or fail with a clear re-login path.

What does an Open WebUI rollout with JWT auth cost and take?

What drives the effort and cost of an Open WebUI rollout with JWT auth?

The main drivers are the number of IdP groups you need to map to teams and model access, how mature your identity provider configuration already is, how many Open WebUI and LiteLLM replicas you run, how many model providers and private models sit behind the gateway, and how deeply the setup is tested. Each driver adds design, configuration and verification work. A small pilot with one group and one provider is far smaller than a multi-replica rollout with several groups, budgets and audit requirements. Ask any partner to show how each driver changes the written scope before comparing quotes.

Which parts of the rollout are one-time work and which recur?

One-time work includes designing the group model, configuring the IdP client and token claims, deploying Open WebUI and LiteLLM, setting up PostgreSQL and Redis for multiple replicas, building teams and budgets, and testing. Recurring costs include license fees where they apply, upgrades for Open WebUI, LiteLLM and the identity provider, and tracking security releases for each. The JWT authentication path in LiteLLM requires a LiteLLM license, so confirm its current licensing terms with the vendor before you commit. Ask the quote to split one-time and recurring items separately.

Can our own platform team build this without an outside partner?

Yes, if your team has administrator access to the identity provider, experience running Kubernetes or Docker Compose, and time to test token claims, group mapping and budget behavior end to end. The hardest parts are usually the token claim design, the group-to-team mapping and proving that a user cannot reach another team's models or spend. Many teams build a pilot in-house and bring in a partner for the hardening, scaling and evidence needed for a security review. Decide which of those pieces you want to own before you start.

What do we need to provide before the work starts?

You need administrator access to the identity provider and a named owner for group design, along with a decision on which groups map to which teams and models. You also need a hosting environment with the database, Redis and shared file storage that multi-replica operation requires, and a test cohort of real users who can validate sign-in, model access and budgets before wider release. Expect to provide sign-off on the group model and a contact who can approve changes during testing. Missing identity provider access is the most common cause of delay.

How do identity provider maturity and group design affect the timeline?

A clean identity provider with well-defined groups, a working OIDC client and consistent user attributes shortens the work considerably. If groups are inconsistent, nested in unexpected ways, or managed manually, the design phase grows because each group needs an explicit decision about model access and budget. Open WebUI supports SCIM 2.0 provisioning, so confirm whether your identity provider exposes groups to it. Ask the partner to review your current group structure before estimating duration.

Why does DeployOpen not give a price or duration without a written scope?

A price or duration depends on the scope, and the scope depends on the drivers above: groups, identity provider maturity, replicas, providers and testing depth. Any figure given before those are fixed would be a guess and would likely change. DeployOpen agrees scope, deliverables and timelines in writing before work starts, and a quote follows from that document. Ask for the written scope to list each assumption, each client responsibility and each recurring item so you can compare proposals on equal terms.

Which Open WebUI license terms should we check before a company-wide rollout?

Since v0.6.6, Open WebUI code is distributed under the Open WebUI License, which forbids removing or altering branding in deployments above 50 users in any rolling 30-day period unless you hold an enterprise license or written contributor permission. Confirm the expected seat count with Open WebUI enterprise sales, because the threshold changes which terms apply. Enterprise pricing is not published and must be requested directly. Include the license decision in the written scope so that cost and compliance are settled before rollout.

How DeployOpen scopes and delivers this rollout

DeployOpen plans and builds this rollout as a fixed-scope engagement inside your own infrastructure, covering the identity provider, Open WebUI, LiteLLM and the database and Redis tiers they depend on. The work ends with a documented, tested setup that your security and platform teams can review and operate.

How we scope

  • Confirm which identity provider, group structure and user count the rollout must serve before any build starts.
  • Agree in writing which model providers, private models, teams and budgets are in the first release.
  • Record the Open WebUI, LiteLLM and Keycloak versions to be used, and the LITELLM_LICENSE requirement for JWT authentication.
  • Define the deployment target, data stores, storage for uploads and the logging destinations your teams need.

How we build

  • Configure the identity provider to issue access tokens that LiteLLM can validate, and map IdP groups to LiteLLM teams and model access.
  • Deploy Open WebUI and LiteLLM with PostgreSQL, Redis and shared file storage where more than one replica runs.
  • Set secrets, including the master key, in your secret manager and apply budgets, rate limits and model restrictions per team.
  • Test sign-in, token validation, group changes and budget enforcement end to end before handover.

How we hand over

  • Deliver written documentation of the architecture, token flow, group-to-team mapping and configuration as code.
  • Walk your operations and security teams through upgrade steps, Keycloak and LiteLLM release handling and recovery.
  • Provide a runbook covering user onboarding and offboarding through group membership, with no shared keys to rotate.
  • Hand over test evidence and a list of open items that your teams or auditors may want to review.

How we support

  • Offer ongoing support, upgrades and continuous testing as a retainer after the initial rollout is accepted.
  • Plan version upgrades for Open WebUI, LiteLLM and Keycloak as separate, tested changes with rollback steps.
  • Retest access controls, budgets and logging after group structure changes or significant version upgrades.
  • Confirm support terms, response expectations and licensing for each component with the vendor before the quote is final.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.