Configuration de votre application Web et du serveur pour l'authentification par certificat client

Vous pouvez configurer votre application Web dans Liberty à l'aide de l'authentification client SSL.

Avant de commencer

Cette rubrique suppose que vous avez déjà créé les certificats SSL, par exemple, en suivant les instructions de la section Création de certificats SSL depuis la ligne de commande.

Pourquoi et quand exécuter cette tâche

L'authentification par certificat client a lieu si le côté serveur exige du côté client qu'il envoie un certificat. Un serveur WebSphere peut être configuré pour l'authentification par certificat client dans la configuration SSL. Pour ce faire, vous ajoutez la fonction Liberty ssl-1.0 au fichier server.xml, avec le code qui indique au serveur les informations de fichier de clés pour l'authentification.

Pour savoir quels aspects de SSL sont pris en charge, voir Fonctions Liberty.

Procédure

  1. Assurez-vous que le descripteur de déploiement de votre application Web spécifie l'authentification par certificat client comme méthode d'authentification.
    Vérifiez que le descripteur de déploiement inclut l'élément suivant :
    <auth-method>CLIENT-CERT</auth-method>
    Remarque : You can use a tool such as Rational Application Developer to create the deployment descriptor.
  2. Facultatif : Generate an SSL certificate using the command line. See commande securityUtility.
  3. Configure your server to enable SSL client authentication by adding the following lines to the server.xml file:
       <featureManager>
            <feature>ssl-1.0</feature>
       <featureManager>
    
       <ssl id="defaultSSLConfig" keyStoreRef="defaultKeyStore" 
            trustStoreRef="defaultTrustStore" clientAuthenticationSupported="true" />
       <keyStore id="defaultKeyStore" location="key.jks" type="JKS" password="defaultPWD" />
       <keyStore id="defaultTrustStore" location="trust.jks" type="JKS" password="defaultPWD" />
    • If you specify clientAuthentication="true", the server requests that a client sends a certificate. However, if the client does not have a certificate, or the certificate is not trusted by the server, the handshake does not succeed.
    • If you specify clientAuthenticationSupported="true", the server requests that a client sends a certificate. However, if the client does not have a certificate, or the certificate is not trusted by the server, the handshake might still succeed.
    • If you do not specify either clientAuthentication or clientAuthenticationSupported, or you specify clientAuthentication="false" or clientAuthenticationSupported="false", the server does not request that a client send a certificate during the handshake.
  4. Add a client certificate to your browser. See the documentation of your browser for adding client certificates.
  5. Make sure the server trusts any client certificates that are used.
  6. Make sure any client certificates used for client authentication are mapped to a user identity in your registry.
    • For the basic registry, the user identity is the common name (CN) from the distinguished name (DN) of the certificate.
    • For a Lightweight Directory Access Protocol (LDAP) registry, the DN from the client certificate must be in the LDAP registry.
  7. To use basic authentication, user ID and password only, if client certificate authentication does not succeed, add the following line to your server.xml file.
    <webAppSecurity allowFailOverToBasicAuth="true" />
    Remarque : If you specify allowFailOverToBasicAuth="false" or do not specify allowFailOvertoBasicAuth, and the client certificate authentication does not succeed, the request generates a 403 Authentication error message, and the client is not prompted for basic authentication.

Icône indiquant le type de rubrique Rubrique Tâche

Nom du fichier : twlp_sec_clientcert.html