i need logon user on application verifying credentials. found old logonuser api , new principalcontext object. i'd use principalcontext because it's easy , smart, know usign logonuser can token use impersonating user? impersonation? there way same thing using principalcontext?
thank you
you typically use impersonation if need execute application different user (usually more/specific access) 1 logged in.
the term "impersonation" in programming context refers technique executes code under user context user started application, i.e. user context temporarily changed once or multiple times during execution of application.
if need authenticate user , validate credentials, can use principalcontext.
using (principalcontext ctx = new principalcontext(contexttype.domain, "yourdomain.com")) { bool auth = ctx.validatecredentials(username,password); }
Comments
Post a Comment