-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GetGroupsFromActiveDirectory: Allow the use of Encryption aka SecureSocketLayer with SimpleBind #232
Comments
If you could also add |
Hello @ChristophHannappel, not sure how to do what you ask: |
Hello @Yvand with the AuthenticationTypes set to Value 2 wouldn't that mean Simple Bind with Encryption and SecureSocketLayer and if set to 3 it would be NTLM Auth with SecureSocketLayer and Encryption As a PowerShell Example for using SimpleBind with SecureSocketLayer for Augementation: Add-Type -AssemblyName System.DirectoryServices.AccountManagement
$ldapUser = "DOMAIN\user"
if (!$ldapPassword) { $ldapPassword = Read-Host "Enter the password (will appear in clear text)" }
$userToAugment = "userName"
$domainFQDN = "DomainFQDN:636"
# domainContainer must be set, otherwise UserPrincipal.FindByIdentity throsws error 0x80005000 (tested only in AD)
$domainContainer = "DC=fhhnet,DC=stadt,DC=hamburg,DC=de"
$contextOptions = [System.DirectoryServices.AccountManagement.ContextOptions] "SimpleBind, SecureSocketLayer" # Encrypted connection, traffic unreadable in network analyzer
$contextType = [System.DirectoryServices.AccountManagement.ContextType]::Domain
$principalContext = [System.DirectoryServices.AccountManagement.PrincipalContext]::new($contextType, $domainFQDN , $domainContainer, $contextOptions, $ldapUser, $ldapPassword)
if ($principalContext -ne $null -and [String]::IsNullOrEmpty($principalContext.ConnectedServer) -eq $false) {
$user = [System.DirectoryServices.AccountManagement.UserPrincipal]::FindByIdentity($principalContext, $userToAugment)
$groups = $user.GetAuthorizationGroups()
# The foreach group calls an enumerator that does separate LDAP binds for each group
$groupNames = foreach($group in $groups) {
$group.SamAccountName
}
$groupNames | Sort-Object
} As an alternative Idea, do you have any documentation for unsupported use cases or Limitations? Thank you |
@ChristophHannappel maybe you're right, so the possible mappings would be:
Is that correct? |
Hello,
currently it's not possible to use the
SimpleBind
in companion withSecureSocketLayer
.According to System.DirectoryServices.AccountManagement it should be possible to use them together:
The code in question is:
LDAPCP/Yvand.LDAPCPSE/Yvand.LdapClaimsProvider/LdapEntityProvider.cs
Line 68 in e9c0af0
Could you add support for the
SecureSocketLayer
ContextOption if theEncrypt
AuthenticationType is present at the LDAP Connection.Thank you
The text was updated successfully, but these errors were encountered: