Version 4

    This document describes the steps needed to enable JASPI authentication for Web applications on JBoss AS7.


    Application Server Configuration


    The first step to enable JASPI is to configure a security domain that installs the JASPI login modules. So, in your standalone.xml (or domain.xml if using domain mode), add the JASPI configuration in the security subsystem:


                    <!-- security domain configuration for the jaspi web basic test -->
                    <security-domain name="jaspi-test" cache-type="default">
                            <login-module-stack name="lm-stack">
                                <login-module code="UsersRoles" flag="required">
                                    <module-option name="usersProperties" value="../standalone/configuration/"/>
                                    <module-option name="rolesProperties" value="../standalone/configuration/"/>
                            <auth-module code="" login-module-stack-ref="lm-stack" flag="required"/>


    In this example we are configuring the HTTPBasicServerAuthModule, which will perform the BASIC authentication of a Web application. If FORM authentication is desired, just change the auth-module to Notice the configuration style is very similar to what is found in previous JBoss AS versions. The configured JASPI module can delegate the authentication and role mapping processes to a login module stack. In this case, we're using a simple UsersRoles module to authenticate and obtain roles for the users.


    The sample security-domain can also be configured by using CLI management tool using following commands:


    /subsystem=security/security-domain=jaspi-test/authentication=jaspi:add(auth-modules=[{"code"=>"", "login-module-stack-ref"=>"lm-stack", "flag"=>"required"}])
    /subsystem=security/security-domain=jaspi-test/authentication=jaspi/login-module-stack=lm-stack:add(login-modules=[{"code"=>"UsersRoles", "flag"=>"required", "module-options"=>{"usersProperties"=>"../standalone/configuration/", "rolesProperties"=>"../standalone/configuration/"}}], operation-headers={"allow-resource-service-restart"=>"true"})


    Web Application Configuration


    The next step is to configure the Web application. First, we specify the type of authentication that is to be performed. For example, an application that requires BASIC authentication must specify that in the WEB-INF/web.xml file:


    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" xmlns=""


    Finally, we need to link the Web application to the security domain that will perform the authentication and configure the valve that will enable the JASPI authentication. Both things are done in the WEB-INF/jboss-web.xml file:


    <?xml version="1.0"?>


    The specified <security-domain> must match the name of the security domain that has been configured in the application server. It is also important that the WebJASPIAuthenticatorValve is configured as this valve replaces the Web container authenticator ir order to perform the JASPI authentication.


    NOTE: the WebJASPIAuthenticator replaces the previous and MUST be configured in the jboss-web.xml file. JBoss AS7 doesn't allow for the configuration of authenticator valves in the JBossWeb subsystem like previous versions.