For some reason, I cannot authenticate user credentials using LDS for users 开发者_如何学JAVAcreated in LDS.
My test code is:
        PrincipalContext context = new PrincipalContext(ContextType.ApplicationDirectory, "adlds:50000", "CN=test,DC=test,DC=internal", ContextOptions.Negotiate);
        UserPrincipal user = new UserPrincipal(context);
        user.Enabled = true;
        user.Name = "MyTestUser";
        user.SetPassword("P@ssw0rd1");
        user.GivenName = "ATestUser123";
        user.Surname = "SurnameOf";
        user.Save();
        bool auth = context.ValidateCredentials("MyTestUser", "P@ssw0rd1");
ValidateCredentials is returning false each time.
LDS is running on Server 2008 R2 that is domain joined. I have tried recreating the context, expiring passwords, manually reseting passwords through ADSI, etc.
Any thoughts?
I've come along the same problem. What I did, and works for me, is when calling ValidateCredentials I modified the username a bit:
bool auth = context.ValidateCredentials(
                            String.Format("CN={0},CN=test,DC=test,DC=internal",
                                          "MyTestUser"), 
                            "P@ssw0rd1");
Hope this helps.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论