asp.net - How can I use DirectoryEntry in SignInManager? -
i've create company web using asp.net using directoryentry method authenticated user logged in member of company. in case of admin didn't allow iis server join domain, cannot use direct windows authentication method.
by using simple function i've got stackoverflow (thanks original coder)
function authenticateuser(user string, pass string) boolean dim de new directoryentry("ldap://xxx.xxx.xxx.xxx", user, pass, authenticationtypes.secure) try 'run search using credentials. 'if returns anything, you're authenticated dim ds directorysearcher = new directorysearcher(de) ds.findone() return true catch 'otherwise, crash out return false return false end try end function
after tried moving c# asp.net mvc. don't have ideas how modify simple directoryentry applicationsigninmanager method ?
var result = await signinmanager.passwordsigninasync(model.email, model.password, model.rememberme, shouldlockout: false); switch (result) { case signinstatus.success: return redirecttolocal(returnurl); case signinstatus.lockedout: return view("lockout"); case signinstatus.requiresverification: return redirecttoaction("sendcode", new { returnurl = returnurl, rememberme = model.rememberme }); case signinstatus.failure: default: modelstate.addmodelerror("", "invalid login attempt."); return view(model); }
i didn't want users register web. how can modify signinmanager using username , password , send them directorysearch ?
Comments
Post a Comment