Basic IIS Authentication Using LDAP

I have a web service that should use HTTP authentication with IIS. The only obstacle is that the user credentials are in LDAP. Is there a way to configure IIS to use LDAP credentials for basic authentication? I thought I could set a default domain or scope for part of the LDAP connection string, but had no luck. Thanks,

-Will be

+6
source share
2 answers

What would I do (I assume that you are using third-party LDAP, and that there is no built-in way to do this, I did not check) I configured MADAM and implement a custom IUserSecurityAuthority by expanding Madam.UserSecurityAuthorityBase to verify credentials for LDAP.

All you have to do is override several authentication methods from LDAP. If you use an LDAP membership provider to authenticate forms, you can skip the implementation of this separately and use the MembershipSecurityAuthority example included in MADAM.

An excerpt from this example is here:

 protected override bool ValidateUser(string userName, string password) { return MembershipProvider.ValidateUser(userName, password); } 

Potentially Useful LDAP User Verification Code

+1
source

There is a codeplex project that looks like it has exactly what you need.

It has an excellent search function, so you can even check what roles the user has.

http://ldapwebservice.codeplex.com/

0
source

Source: https://habr.com/ru/post/897180/


All Articles