Karan Thakkar

Karan Thakkar

  • 1.7k
  • 202
  • 19.6k

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,
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. 

Brought to you by: JavaScript SDK for Bold BI dashboard and analytics embedding. Free trial.

Answers (1)