Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add property GroupMembershipAttributes to allow customize LDAP attrib…
…utes used for augmentation #67
- Loading branch information
Showing
6 changed files
with
61 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using ldapcp; | ||
using NUnit.Framework; | ||
|
||
namespace LDAPCP.Tests | ||
{ | ||
[TestFixture] | ||
[Parallelizable(ParallelScope.Children)] | ||
public class AugmentationAsLDAPServersTests : EntityTestsBase | ||
{ | ||
public override bool TestSearch => false; | ||
public override bool TestValidation => false; | ||
public override bool TestAugmentation => true; | ||
|
||
public override void InitializeConfiguration() | ||
{ | ||
base.InitializeConfiguration(); | ||
Config.EnableAugmentation = true; | ||
Config.MainGroupClaimType = ClaimsProviderConstants.DefaultMainGroupClaimType; | ||
foreach (LDAPConnection ldapConn in Config.LDAPConnectionsProp) | ||
{ | ||
ldapConn.AugmentationEnabled = true; | ||
ldapConn.GetGroupMembershipAsADDomainProp = false; | ||
ldapConn.GroupMembershipAttributes = new string[] { "memberOf", "uniquememberof" }; | ||
} | ||
Config.Update(); | ||
} | ||
|
||
[TestCase("yvand@contoso.local", true)] | ||
[TestCase("zzzyvand@contoso.local", false)] | ||
public override void DEBUG_AugmentEntity(string claimValue, bool isMemberOfTrustedGroup) | ||
{ | ||
//LDAPConnection coco = new LDAPConnection(); | ||
//coco.AugmentationEnabled = true; | ||
//coco.GetGroupMembershipAsADDomainProp = false; | ||
//coco.UserServerDirectoryEntry = false; | ||
//coco.Path = "LDAP://test"; | ||
//coco.Username = "userTest"; | ||
//Config.LDAPConnectionsProp.Add(coco); | ||
//Config.Update(); | ||
UnitTestsHelper.TestAugmentationOperation(UnitTestsHelper.SPTrust.IdentityClaimTypeInformation.MappedClaimType, claimValue, isMemberOfTrustedGroup); | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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