14.9. Configurer SPNEGO avec un renvoi à l'authentification Form
Suivre la procédure ci-dessous pour configurer un SPNEGO avec un renvoi à l'authentification Form.
Procédure 14.2. Sécurité SPNEGO avec renvoi à l'authentification Form
Configurer SPNEGO
Voir la procédure décrite dans Section 14.8, « Configuration de Kerberos ou Microsoft Active Directory Desktop SSO pour les applications web »Modifier le fichier
web.xml
Ajouter un élémentlogin-config
à votre application et configurer les pages de connexion et d'erreurs dans le fichier web.xml :<login-config> <auth-method>SPNEGO</auth-method> <realm-name>SPNEGO</realm-name> <form-login-config> <form-login-page>/login.jsp</form-login-page> <form-error-page>/error.jsp</form-error-page> </form-login-config> </login-config>
Ajouter un contenu web
Ajouter des references delogin.html
et deerror.html
àweb.xml
. Ces fichiers sont ajoutés à l'archive d'application web à l'emplacement spécifié dans la configurationform-login-config
. Pour obtenir des informations, voir la section Enable Form-based Authentication du Security Guide de JBoss EAP 6. Un fichierlogin.html
typique ressemble à ceci :<html> <head> <title>Vault Form Authentication</title> </head> <body> <h1>Vault Login Page</h1> <p> <form method="post" action="j_security_check"> <table> <tr> <td>Username</td><td>-</td> <td><input type="text" name="j_username"></td> </tr> <tr> <td>Password</td><td>-</td> <td><input type="password" name="j_password"></td> </tr> <tr> <td colspan="2"><input type="submit"></td> </tr> </table> </form> </p> <hr> </body> </html>
Note
Le renvoi à la logique FORM n'est disponible que dans le cas où il n'y a pas de SPNEGO (ni de NTLM). De ce fait, un formulaire de connexion n'est pas présenté au navigateur si le navigateur envoie un token NTLM.