Do we know how to implement LDAP support for the new authentication system introduced in VS 2013 which is based on owin.org .
I have written my own provider using Forms authentication but it doesnt work any more.
Any ways to extend this will also be highly welcome. All I see is built in support for a lot of oauth providers like Google, Twitter and Facebook.
It's actually pretty easy. You simply need to override the CheckPasswordAsync method in the provided UserManager. (Full disclosure, that's my blog post).
public class ApplicationUserManager : UserManager<ApplicationUser> {
//...SNIP...
public override async Task<bool> CheckPasswordAsync(ApplicationUser user, string password)
{
return await Task.Run(() => {
_context = new PrincipalContext(ContextType.Domain);
return _context.ValidateCredentials(user.UserName, password, ContextOptions.Negotiate)
});
}
}
That's a very naiive method, but it should work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With