Open
Document LDAP group CN requirements for Negotiate roles#69024
Conversation
6 tasks
Co-authored-by: rokonec <25249058+rokonec@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Document LDAP group common-name requirements for Negotiate role claims
Document LDAP group CN requirements for Negotiate roles
Sep 3, 2026
rokonec
approved these changes
Sep 3, 2026
rokonec
marked this pull request as ready for review
September 3, 2026 14:35
rokonec
requested review from
Youssef1313,
cincuranet and
halter73
as code owners
September 3, 2026 14:35
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The change is documentation/comment-only, preserves runtime behavior, and clearly communicates the existing CN-based role claim behavior.
Pull request overview
This PR documents an important behavioral detail of Negotiate’s LDAP claim resolution: group memberships are projected to role claims using only the group common name (CN), and distinguished-name scope (such as organizational units) is not retained—so duplicate CNs across OUs cannot be disambiguated for role authorization.
Changes:
- Adds
<remarks>to bothNegotiateOptions.EnableLdapoverloads describing CN-based role claim projection and its uniqueness limitation. - Adds an inline maintainer comment in
LdapAdapterreinforcing the CN-only contract at the point claims are collected.
File summaries
| File | Description |
|---|---|
| src/Security/Authentication/Negotiate/src/NegotiateOptions.cs | Adds XML doc remarks to both EnableLdap overloads documenting CN-only LDAP group-to-role mapping and its limitations. |
| src/Security/Authentication/Negotiate/src/Internal/LdapAdapter.cs | Adds an inline comment clarifying that only CN is used for emitted role claim values. |
Review details
Suppressed comments (1)
src/Security/Authentication/Negotiate/src/NegotiateOptions.cs:75
- Same as the other EnableLdap overload: use standard LDAP terms (OU/DN) and avoid contractions/hyphenation in the API remarks for clarity and consistency.
/// <remarks>
/// LDAP group memberships are represented as role claims using each group's common name (CN) as the role value.
/// Organizational-unit and other distinguished-name components aren't preserved. Role-based authorization with
/// duplicate group CNs across organizational units isn't supported.
/// </remarks>
- Files reviewed: 2/2 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
| } | ||
|
|
||
| var distinguishedName = settings.Domain.Split('.').Select(name => $"dc={name}").Aggregate((a, b) => $"{a},{b}"); | ||
| // Role claims intentionally use only each group's CN; other distinguished-name components aren't preserved. |
Comment on lines
+54
to
+58
| /// <remarks> | ||
| /// LDAP group memberships are represented as role claims using each group's common name (CN) as the role value. | ||
| /// Organizational-unit and other distinguished-name components aren't preserved. Role-based authorization with | ||
| /// duplicate group CNs across organizational units isn't supported. | ||
| /// </remarks> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Document that LDAP group memberships become role claims based solely on each group’s common name (CN). Organizational-unit and other distinguished-name components are not preserved, so role authorization does not support duplicate CNs across organizational units.
Description
EnableLdapoverloads describing the CN-based role projection and its uniqueness requirement.