Skip to content

Commit ff3f356

Browse files
docs(docs/): add app role support to docs
1 parent d28ecbc commit ff3f356

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

docs/my-website/docs/proxy/admin_ui_sso.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,23 @@ MICROSOFT_TENANT="5a39737
8181
http://localhost:4000/sso/callback
8282
```
8383
84+
**Using App Roles for User Permissions**
85+
86+
You can assign user roles directly from Entra ID using App Roles. LiteLLM will automatically read the app roles from the JWT token and assign the corresponding role to the user.
87+
88+
Supported roles:
89+
- `proxy_admin` - Admin over the platform
90+
- `proxy_admin_viewer` - Can login, view all keys, view all spend (read-only)
91+
- `org_admin` - Admin over a specific organization
92+
- `internal_user` - Can login, view/create/delete their own keys, view their spend
93+
94+
To set up app roles:
95+
1. Navigate to your App Registration on https://portal.azure.com/
96+
2. Go to "App roles" and create a new app role
97+
3. Use one of the supported role names above (e.g., `proxy_admin`)
98+
4. Assign users to these roles in your Enterprise Application
99+
5. When users sign in via SSO, LiteLLM will automatically assign them the corresponding role
100+
84101
</TabItem>
85102
86103
<TabItem value="Generic" label="Generic SSO Provider">

docs/my-website/docs/tutorials/msft_sso.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,58 @@ litellm_settings:
140140
<Image img={require('../../img/msft_default_settings.png')} style={{ width: '900px', height: 'auto' }} />
141141

142142

143+
## 4. Using Entra ID App Roles for User Permissions
144+
145+
You can assign user roles directly from Entra ID using App Roles. LiteLLM will automatically read the app roles from the JWT token during SSO sign-in and assign the corresponding role to the user.
146+
147+
### 4.1 Supported Roles
148+
149+
LiteLLM supports the following app roles (case-insensitive):
150+
151+
- `proxy_admin` - Admin over the entire LiteLLM platform
152+
- `proxy_admin_viewer` - Read-only admin access (can view all keys and spend)
153+
- `org_admin` - Admin over a specific organization (can create teams and users within their org)
154+
- `internal_user` - Standard user (can create/view/delete their own keys and view their own spend)
155+
156+
### 4.2 Create App Roles in Entra ID
157+
158+
1. Navigate to your App Registration on https://portal.azure.com/
159+
2. Go to **App roles** > **Create app role**
160+
161+
<Image img={require('../../img/entra_app_roles_1.png')} style={{ width: '800px', height: 'auto' }} />
162+
163+
3. Configure the app role:
164+
- **Display name**: Proxy Admin (or your preferred display name)
165+
- **Value**: `proxy_admin` (use one of the supported role values above)
166+
- **Description**: Administrator access to LiteLLM proxy
167+
- **Allowed member types**: Users/Groups
168+
169+
<Image img={require('../../img/entra_app_roles_2.png')} style={{ width: '800px', height: 'auto' }} />
170+
171+
4. Click **Apply** to save the role
172+
173+
### 4.3 Assign Users to App Roles
174+
175+
1. Navigate to **Enterprise Applications** on https://portal.azure.com/
176+
2. Select your LiteLLM application
177+
3. Go to **Users and groups** > **Add user/group**
178+
4. Select the user and assign them to one of the app roles you created
179+
180+
<Image img={require('../../img/entra_app_roles_3.png')} style={{ width: '800px', height: 'auto' }} />
181+
182+
### 4.4 Test the Role Assignment
183+
184+
1. Sign in to LiteLLM UI via SSO as a user with an assigned app role
185+
2. LiteLLM will automatically extract the app role from the JWT token
186+
3. The user will be assigned the corresponding LiteLLM role in the database
187+
4. The user's permissions will reflect their assigned role
188+
189+
**How it works:**
190+
- When a user signs in via Microsoft SSO, LiteLLM extracts the `roles` claim from the JWT `id_token`
191+
- If any of the roles match a valid LiteLLM role (case-insensitive), that role is assigned to the user
192+
- If multiple roles are present, LiteLLM uses the first valid role it finds
193+
- This role assignment persists in the LiteLLM database and determines the user's access level
194+
143195
## Video Walkthrough
144196

145197
This walks through setting up sso auto-add for **Microsoft Entra ID**

0 commit comments

Comments
 (0)