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
Copy file name to clipboardExpand all lines: docs/operator-manual/user-management/microsoft.md
+87Lines changed: 87 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -124,6 +124,93 @@
124
124
125
125
Refer to [operator-manual/argocd-rbac-cm.yaml](https://github.com/argoproj/argo-cd/blob/master/docs/operator-manual/argocd-rbac-cm.yaml) for all of the available variables.
126
126
127
+
## Azure AD Groups Overflow Resolution (200+ Groups)
128
+
129
+
### Overview
130
+
131
+
Azure AD / Entra ID access tokens can contain a maximum of 200 groups. When a user belongs to more
132
+
than 200 groups, Azure AD sets overflow indicators (`_claim_names` and `_claim_sources`) in the ID
133
+
token instead of including the `groups` claim. This causes users to have no group-based RBAC
134
+
permissions in Argo CD.
135
+
136
+
Argo CD can automatically detect this overflow and resolve it by calling the Microsoft Graph API to
137
+
fetch the complete list of group memberships.
138
+
139
+
### Prerequisites
140
+
141
+
1. The Azure AD app registration must have the **User.Read** delegated permission. This is granted by
142
+
default when following the [Setup permissions](#setup-permissions-for-entra-id-application) steps
143
+
above. Azure AD automatically includes approved permissions in the access token's `scp` claim
144
+
without needing to explicitly request them in `requestedScopes`.
145
+
146
+
### Configuration
147
+
148
+
Add the following to your `argocd-cm` ConfigMap under `oidc.config`:
| `enableUserGroupOverageClaim` | `false` | Enable automatic overflow resolution via Graph API |
169
+
| `graphApiEndpoint` | `https://graph.microsoft.com/v1.0` | Graph API base URL (override for sovereign clouds) |
170
+
| `userGroupOverageClaimCacheExpiration` | Token expiry | Cache duration for resolved groups (e.g., `10m`) |
171
+
172
+
#### Sovereign Clouds
173
+
174
+
For Azure Government, Azure China, or other sovereign clouds, override the Graph API endpoint:
175
+
176
+
```yaml
177
+
azure:
178
+
enableUserGroupOverageClaim: true
179
+
graphApiEndpoint: https://graph.microsoft.us/v1.0 # Azure Government
180
+
```
181
+
182
+
### How It Works
183
+
184
+
1. **Detection**: Argo CD checks the ID token for overflow indicators (`_claim_names` and
185
+
`_claim_sources`).
186
+
2. **Scope Check**: Verifies the access token contains the `User.Read` scope.
187
+
3. **Graph API Call**: Calls `POST /me/getMemberGroups` to fetch all group IDs (up to 2048).
188
+
Only security-enabled groups are returned (not distribution lists), which is appropriate
189
+
for RBAC evaluation.
190
+
4. **Caching**: Encrypts and caches the resolved groups for the duration of the token or a
191
+
configured expiration.
192
+
5. **RBAC Integration**: The resolved group IDs are added to the user's claims for RBAC evaluation.
193
+
194
+
### Troubleshooting
195
+
196
+
| Symptom | Cause | Solution |
197
+
|---------|-------|----------|
198
+
| User still has 0 groups despite 200+ memberships | Feature not enabled | Set `enableUserGroupOverageClaim: true` |
199
+
| Logs show "access token missing User.Read scope" | Missing permission | Verify the **User.Read** delegated permission is granted on the app registration in Azure AD |
200
+
| Logs show "insufficient permissions for Graph API" | App permission denied | Verify app permissions in Azure AD |
201
+
| Logs show "no access token cached" | Token expired | User must re-authenticate |
202
+
203
+
> [!WARNING]
204
+
> This feature depends on the Microsoft Graph API being reachable at authentication time. If the
205
+
> Graph API is unavailable (network issues, outage, etc.), users with 200+ group memberships will
206
+
> be unable to authenticate until service is restored. Users with fewer than 200 groups are
207
+
> unaffected since their groups are included directly in the ID token.
208
+
>
209
+
> Graph API failures (missing scope, permission denied, network errors) will cause authentication
210
+
> to fail with a 401 Unauthorized response. This is consistent with how the UserInfo endpoint
211
+
> behaves. Only enable this feature if you need group-based RBAC for users with 200+ groups, and
212
+
> ensure the prerequisites above are met to avoid authentication issues.
returngroupClaims, fmt.Errorf("error while querying userinfo endpoint: %w", err)
920
+
}
921
+
iferr!=nil {
922
+
returngroupClaims, fmt.Errorf("error fetching user info endpoint: %w", err)
923
+
}
924
+
ifgroupClaims["sub"] !=userInfo["sub"] {
925
+
returngroupClaims, errors.New("subject of claims from user info endpoint didn't match subject of idToken, see https://openid.net/specs/openid-connect-core-1_0.html#UserInfo")
926
+
}
927
+
groupClaims["groups"] =userInfo["groups"]
928
+
returngroupClaims, nil
908
929
}
909
-
ifgroupClaims["sub"] !=userInfo["sub"] {
910
-
returngroupClaims, errors.New("subject of claims from user info endpoint didn't match subject of idToken, see https://openid.net/specs/openid-connect-core-1_0.html#UserInfo")
930
+
931
+
// Path 2: Azure AD groups overage claim resolution via Microsoft Graph API
0 commit comments