user2550231
user2550231

Reputation: 111

AD LDS Authentication using PrincipalContext

I am trying to authenticate using AD LDS. I installed AD LDS on my machine.

I use System.DirectoryServices.AccountManagement.PrincipalContext.ValidateCredentials for authentication.

I create PrincipalContext as

PrincipalContext oPrincipalContext = 
      newPrincipalContext(ContextType.ApplicationDirectory, "localhost:389", "");

Server name and port number I am passing, I am not able to figure out what is the value that needs to be passed for container.

Kindly let me know what is value we need to pass for container?

Where this value is taken from?

How do i configure this value in AD LDS? (is this specified during installation)

What is relevance of specifying container name?

Upvotes: 2

Views: 1211

Answers (1)

Dave Evans
Dave Evans

Reputation: 1

According to https://msdn.microsoft.com/en-us/library/system.directoryservices.accountmanagement.principalcontext.container%28v=vs.110%29.aspx this should be the distinguished name of the container in your AD LDS instance you wish to read from/insert into.

i.e. "CN=Users,DC=MyCustomDomain,DC=COM"

Upvotes: 0

Related Questions