BlogClaude Code
Claude Code sign-in with company SSO through LiteLLM
Developers can sign in to Claude Code with their company account, without ever holding an API key. The LiteLLM gateway handles the sign-in through your identity provider and gives Claude Code a session that belongs to one user and one team. You switch on one setting in the gateway and roll out one settings file to the laptops. Before you rely on it, know how long a session lives and what removing a user in the identity provider does not do. As of 27 November 2026.
What you need
- Claude Code 2.1.195 or newer on the developers' machines.
- LiteLLM 1.106.0 or newer for session renewal and sign-out. From 1.109.0 a developer who belongs to several teams can choose one at sign-in.
- Single sign-on already working for the LiteLLM admin UI. Entra ID, Google, Okta and any OpenID Connect provider are supported. Beyond five users, SSO needs a LiteLLM Enterprise licence.
- Redis as soon as the gateway runs on more than one replica.
- A gateway address that resolves to a private network address and is served over TLS.
Setting it up
On the gateway, the setting goes into the config file. It cannot be switched on in the admin UI. Claude Code also needs a model entry it can reach, and a wildcard for Anthropic models is the simplest one.
general_settings:
enable_claude_code_gateway: true
model_list:
- model_name: "anthropic/*"
litellm_params:
model: "anthropic/*"
api_key: os.environ/ANTHROPIC_API_KEYOn the laptops, a managed settings file tells Claude Code to sign in through the gateway and nowhere else. Your device management distributes it. On macOS it lives at /Library/Application Support/ClaudeCode/managed-settings.json, on Linux at /etc/claude-code/managed-settings.json and on Windows at C:\Program Files\ClaudeCode\managed-settings.json.
{
"forceLoginMethod": "gateway",
"forceLoginGatewayUrl": "https://llm.example.internal/claude_code_gateway"
}The developer then starts claude or runs /login, signs in with the company account in the browser and confirms a code. From that point every request carries their identity.
What a session is
A session is tied to one user and one team. Spend, budgets and logs are attributed to them, and the models they can use are the ones on the team's list. That makes cost allocation a by-product of signing in.
| What | Default | Note |
|---|---|---|
| Session token | 24 hours | Configurable up to 336 hours. It cannot be revoked before it expires |
| Renewal | Five minutes before expiry | The gateway checks the user and the team in LiteLLM again |
| Refresh token | 14 days | Single use. /logout revokes it |
Offboarding and sign-out
This is the part to test before you tell security that access is tied to the company account. Three things are easy to assume and are not so.
- Removing someone in the identity provider does not end their session. Renewal checks the user and the team in LiteLLM. Remove the user there as well, or automate it with SCIM.
- /logout revokes the refresh token and not the session token. The session token stays valid until it expires.
- A long session lifetime is a long offboarding delay. With the default of 24 hours, a removed user can work for up to a day. If that is too long for you, shorten the lifetime.
Redis matters here too. While Redis is unreachable, renewal and sign-out fail on a gateway with several replicas.
Limits and alternatives
Two things behave differently on a gateway session. Server-side web search is disabled, and the prompt cache lifetime is five minutes. Check both against how your developers work before you roll out.
If your versions are older or you do not want SSO on the gateway yet, there are two other routes. LiteLLM's own command-line tool can sign a developer in and then start Claude Code. Or each developer gets a virtual key, which Claude Code reads from an environment variable or a helper script. The key route works in the open-source version and needs no SSO, at the price of keys on laptops that someone has to rotate.
Claude Code consulting and rolloutLiteLLM gateway setup and operation
Questions
Can developers use Claude Code without an API key?
Yes. With gateway sign-in they authenticate with the company account through LiteLLM and receive a session. No API key is stored on the laptop.
Does Claude Code SSO through LiteLLM work with Entra ID?
Yes. It uses the same single sign-on configuration as the LiteLLM admin UI, which supports Entra ID, Google, Okta and any OpenID Connect provider.
How quickly does a removed user lose access to Claude Code?
At the next renewal after the user is removed in LiteLLM, which is within 24 hours by default. The current session token cannot be revoked early, so set a shorter lifetime if you need a faster cut-off.
Related services
More from the blog
Coding agents through an LLM gateway
What Claude Code, GitHub Copilot and Cursor each support when you put your own LLM gateway in front of them, as of November 2026, and what to log, budget and test before rollout.
LiteLLM with Microsoft Entra ID
How to connect LiteLLM to Microsoft Entra ID: what single sign-on covers and what it does not, how groups become teams, which roles exist, and why offboarding needs a test of its own.
Rolling out Claude Code in a company
The decisions an engineering lead makes before and during a Claude Code rollout: accounts and provider, managed settings and permissions, what goes into the repository, a pilot with one team, training and the works council.
LiteLLM logging and privacy
Where a LiteLLM gateway can store prompts and answers, which settings keep content out of logs, who is allowed to override them, and what to settle before the first team connects.
Talk to an engineer
Bring one piece of work you would like to improve. The call takes 30 minutes and needs no access to your systems or your data.
Booking runs on Google Calendar.

Mickey Graf
Founder and CEO of Cloudsail
Prefer to write first? Leave your email and a few lines. Mickey reads every message himself and replies by email with times for a call.
Look for the draft in your email program
Send it from there, and Mickey replies in person with times for a 30-minute call. If no draft has opened, write to us at miki@cloudsail.com.