Karan Thakkar

Karan Thakkar

  • 1.5k
  • 204
  • 90.5k

How to pass userid to ldap apache server in ASP.NET Core?

Aug 6 2019 8:09 AM
public User Login()
{
string userid = "user1";
string ldapHost = "localhost:10389";
string searchBase = "o = company";
string searchFilters = "(objectClass=inetOrgPerson)(uid={0})";
int port = 389;
ldapConn.Connect(ldapHost, port);
ldapConn.Bind("uid = admin, ou = system", "secret");
var SearchFilters = string.Format(searchFilters, userid);
LdapSearchResults results = ldapConn.Search(searchBase,
LdapConnection.SCOPE_SUB,
SearchFilters,
null,
false
);
var user = results.next();
}
 
In var user I always a details of user3 randomly weather I pass uid or not?
How will I get particular user on bases of uid from ldap apache server I using novel directory extension in Asp.Net core. 
 
 
 
 

Answers (1)