c# - Validate against AD using email (not sAMAccountName) -


is there way authenticate against ad using email field (and password, sure) ? have both samaccountname , email set on server have validate using mail , not samaccountname.

i using following code authenticate using samaccountname (it´s class library, way...)

using (principalcontext pc = new principalcontext(contexttype.domain, dominio)) {       return pc.validatecredentials(samaccountname, password);                 } 

if have upn (user principal name) set on each user , same email address should able use straight away. upn on form firstname.lastname@domain. default domain name of active directory used, internal (giving e.g. upn anders.abel@company.local). possible register new upn suffix , setting user's email address upn without breaking anything.

otherwise should able attach ad service account, search right user object based on email field, retrive samaccountname , logon using that.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -