J'utilise C# pour authentifier les utilisateurs à mon application comme suit:LDAPS fonctionne sur Visual Studio 2008, mais ne fonctionne pas sur IIS 5.1
LdapConnection connection = null;
try
{
using (connection = new LdapConnection(Configuration.JonahLdapServer))
{
connection.Credential = new NetworkCredential(userName, password, Configuration.JonahDomain);
connection.AuthType = AuthType.Basic;
connection.SessionOptions.SecureSocketLayer = true;
connection.SessionOptions.VerifyServerCertificate =
new VerifyServerCertificateCallback(AlwaysTrustCertificateDelegate);
connection.Bind();
return true;
}
}
Quand je lance ceci dans VS 2008, il fonctionne très bien. Cependant, quand je Déployez l'application à IIS 5.1, il me donne la stacktrace suivante:
System.DirectoryServices.Protocols.LdapException: Le serveur LDAP est indisponible. System.DirectoryServices.Protocols.LdapConnection.Connect() à System.DirectoryServices.Protocols.LdapConnection.BindHelper (NetworkCredential newCredential, Boolean needSetCredential) à System.DirectoryServices.Protocols.LdapConnection.Bind() à Jonahgroup.Lychee.Presentation .Security.SecurityManager.AuthenticateUser (String userName, mot de passe Chaîne)
il convient de noter que si je lance le code sans SSL, il fonctionne très bien sur les deux IIS et VS.
Toute aide serait appréciée.
Je ne comprends pas comment les configurations SSL peuvent entrer en jeu ici. La connexion sécurisée est entre le code et le serveur LDAP. En tant que tel, IIS ne devrait pas se soucier de la façon dont l'authentification est faite (à moins qu'il y ait un besoin de configurer les paramètres ldap avec IIS, dont je ne suis pas au courant). –