You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: Add OIDC Group Synchronization documentation for Keycloak (#426)
* docs: Add OIDC Group Synchronization documentation for Keycloak
Add comprehensive documentation for the new OIDC group sync feature:
- Overview and prerequisites
- Configuration examples for realm roles, client roles, and groups
- Step-by-step setup instructions
- Troubleshooting guide with common claim paths
- Usage examples for permissions
- Limitations and best practices
Covers integration with LibreChat's granular permissions system
for agents, prompts, files, and conversations.
Related to LibreChat PR and issue #10006
* docs: Add group/role exclusion pattern documentation
Document OPENID_GROUPS_EXCLUDE_PATTERN configuration option:
- Explain exact match (case-insensitive) and regex pattern support
- Provide common Keycloak exclusion examples
- Show why to exclude system roles, default roles, and auth roles
- Add practical scenario with admin/developers vs system roles
- Include configuration examples for filtering out:
- offline_access, uma_authorization (system roles)
- default-roles-* (default realm roles)
- manage-account, view-profile (account management)
Complements the group sync feature by allowing fine-grained control
over which roles become groups in LibreChat.
Copy file name to clipboardExpand all lines: pages/docs/configuration/authentication/OAuth2-OIDC/keycloak.mdx
+197Lines changed: 197 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,3 +69,200 @@ If you want to restrict access to users with specific roles, you can define role
69
69
# Optional: redirects the user to the end session endpoint after logging out
70
70
OPENID_USE_END_SESSION_ENDPOINT=true
71
71
```
72
+
73
+
---
74
+
75
+
## OIDC Group Synchronization
76
+
77
+
<Callouttype="info"title="Automatic Group Sync">
78
+
LibreChat can automatically synchronize Keycloak roles/groups to enable granular permissions for agents, prompts, files, and conversations. This feature requires **token reuse** to be enabled.
79
+
</Callout>
80
+
81
+
### Overview
82
+
83
+
The OIDC Group Synchronization feature allows LibreChat to:
84
+
- Automatically extract groups/roles from JWT token claims
85
+
- Create groups in LibreChat's database
86
+
- Sync user memberships on every login
87
+
- Enable ACL-based permissions for shared resources
88
+
- Support any OIDC provider (Keycloak, Auth0, Okta, etc.)
89
+
90
+
### Prerequisites
91
+
92
+
-`OPENID_REUSE_TOKENS=true` must be enabled (see [Token Reuse documentation](/docs/configuration/authentication/OAuth2-OIDC/token-reuse))
93
+
- Keycloak realm roles or groups configured
94
+
- Users assigned to roles/groups in Keycloak
95
+
96
+
### Configuration
97
+
98
+
Add the following variables to your `.env` file:
99
+
100
+
```bash filename=".env"
101
+
# Required: Enable token reuse (prerequisite)
102
+
OPENID_REUSE_TOKENS=true
103
+
104
+
# Enable OIDC group synchronization
105
+
OPENID_SYNC_GROUPS_FROM_TOKEN=true
106
+
107
+
# Path to groups/roles in JWT token (dot notation)
0 commit comments