WCF déploiement sur IIS authentifiation Windows et protection SSL
Bonjour, je vous expose la problématique j'ai déployé un service WCF sur IIS 8.

J'utilise un binding BasicHttpBinding afin de faciliter interopérabilité avec des clients d'autres langages.

Sécurisation du service :
- mode : transport
- clientCredentialType : Windows.

Configuration de l'application sous IIS :
- Dans la partie authentification j'ai désactivé toutes les méthodes sauf WindowsAuthentification.
- Dans la configuration SSL j'ai coché require pour le service et le client.

Quand je test dans un navigateur cela fonctionne à première vue plutôt bien on demande le certificat dans un premier temps et le login mot de passe dans un second temps. Quand je debug le service l'identité courante est bien celle attendu.

Le prolème vient de l'implémentation de mon service je recois l'erreur :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
Additional information: La demande HTTP a été interdite avec le schéma d'authentification du client 'Negotiate'.
J'arrive à faire fonctionner le service si je passe la configuration SSL du certificat client en "accept".

voici la partie du code qui initialise le binding au service :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
 
        ServicePointManager.ServerCertificateValidationCallback = RemoteCertificateValidationCallback;
        BasicHttpBinding myBinding = new BasicHttpBinding();
        myBinding.Security.Mode = BasicHttpSecurityMode.Transport;
        myBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;
        EndpointAddress ea = new EndpointAddress(p_url);
        _instance = new client_service_t(myBinding, ea);
        _instance.ClientCredentials.ClientCertificate.SetCertificate(
            p_cert_store_location,
            p_cert_store_name,
            p_cert_find_type,
            p_cert_find_value);
        _instance.ClientCredentials.Windows.ClientCredential = new NetworkCredential("login", "pwd");
Mon plus gros doute se situe sur le fait de spécifier le certificat client à utiliser pour SSL dans la partie credential pour moi ce code serait plutôt valide dans le cas ou le credential choisie serait "certificate" et non "windows"