I have not worked with Active Directory before and I need to make a connection between Unity standalone implementation in C# and Active Directory installed on a Windows Server 2012 R2 via LDAP. Every time I connect, I get the same error:
LdapException: (49) Invalid Credentials LdapException: Server Message: 8009030C: LdapErr: DSID-0C0903C5, comment: AcceptSecurityContext error, data 2030, v2580
And I am sure that my username and password are correct.
DirectoryEntry entry = new DirectoryEntry("LDAP://"+ serverName+":"+port,userName,password);
DirectorySearcher ds = new DirectorySearcher(entry);
ds.Filter = "XX";
SearchResult result = ds.FindOne();
ResultPropertyCollection rpc = result.Properties;
foreach (string property in rpc.PropertyNames)
{
foreach (object value in rpc[property])
console.text+="Property = " + property + "Value = " + value;
}
}
catch (Exception ex)
{
Debug.Log(ex);
}
I already tried with LdapAdmin (open-source LDAP directory management tool) but I received the same error even with ldp command line in windows PowerShell. Any help will be appreciated. Screenshot
userName? Is itdomain\usernameor[email protected]? (please edit your question rather than adding an answer) - Gabriel Luci