I am creating a secure (SSL) public service where the users credentials reside in Active Directory. I want to leverage ServiceStack\'s Authentication and have read over the wiki
Here is what Demis Bellot said on twitter. Probably possible but needs more research.
Not something I've investigated, don't work in the Win/Active Directory anymore. Requires some R&D to find/resolve the issue
I did eventually get a prototype service working with AD. I implemented the CredentialsAuthProvider. Now this is not tied to ASP.NET IWA at all, but does easily check to see if the user is in AD. Hopefully this might help someone.
public class LDAPAuthProvider : CredentialsAuthProvider
{
public override bool TryAuthenticate(IServiceBase authService, string userName, string password)
{
//Check to see if the username/password combo is valid, an exception will be thrown if the username or password is wrong
try
{
DirectoryEntry entry = new DirectoryEntry(ConfigurationManager.AppSettings["TargetOU"], userName, password);
object nativeObject = entry.NativeObject;
}
catch (Exception)
{
//This means the username/password combo failed
return false;
}
return true;
}
}