I have used below code to authenticate user with Active Directory.
- using (PrincipalContext principalContext1 = new PrincipalContext(ContextType.Domain, domainName))
- {
- if (principalContext1.ValidateCredentials(userName, password))
- {
- //code to successful login
- }
- }
Getting error "The server cannot handle directory requests." in ValidateCredentials method.
I have tried passing contextOptions as third parameter "ContextOptions.Negotiate | ContextOptions.Signing | ContextOptions.Sealing" in ValidateCredentials method.
It resolved my error, but I came to know from msdn that it is default parameter.
Why should I need to pass this? Any alternative solutions? Thanks in advance.
savan savaniPosted Feb 20, 2018, 2:49 AM
Rajneesh ChaubeyPosted Feb 19, 2018, 10:50 AM