4.5. Configure a Web Application to use an Authenticator Valve


Configuring an application to use an authenticator valve requires the valve to be installed and configured (either local to the application or as a global valve) and the web.xml deployment descriptor of the application to be configured. In the simplest case, the web.xml configuration is the same as using BASIC authentication except the auth-method child element of login-config is set to the name of the valve performing the configuration.

Prerequisites

  • Authentication valve must already be created.
  • If the authentication valve is a global valve then it must already be installed and configured, and you must know the name that it was configured as.
  • You need to know the realm name of the security realm that the application will use.
If you do not know the valve or security realm name to use, ask your server administrator for this information.

Procedure 4.2. Configure an Application to use an Authenticator Valve

  1. Configure the valve

    When using a local valve, it must be configured in the applications jboss-web.xml deployment descriptor. Refer to Section 4.4, “Configure a Web Application to use a Valve”.
    When using a global valve, this is unnecessary.
  2. Add security configuration to web.xml

    Add the security configuration to the web.xml file for your application, using the standard elements such as security-constraint, login-config, and security-role. In the login-config element, set the value of auth-method to the name of the authenticator valve. The realm-name element also needs to be set to the name of the JBoss security realm being used by the application.
    <login-config>
       <auth-method>VALVE_NAME</auth-method>
       <realm-name>REALM_NAME</realm-name>
    </login-config>
When the application is deployed, the authentication of requests is handled by the configured authentication valve.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.