此内容没有您所选择的语言版本。
Chapter 3. Additional Features
3.1. Adding a FORM Login as a Fallback 复制链接链接已复制到粘贴板!
JBoss EAP 6 and applications deployed to it can also configure a FORM login authentication mechanism to use as a fallback. This allows applications to present a login page for authentication in cases where a Keberos/SPNEGO tokens are not present. This authentication happens independent of the Kerberos authentication. As a result, depending on how the FORM login fallback is configured, users may require separate credentials to authenticate via this method.
The following steps are required to configure FORM login as a fallback:
The fallback to FORM logic is available in the case when no SPNEGO (or NTLM) tokens are present or SPNEGO token is present but from another KDC.
Please refer to the previous section for the steps required to configure JBoss EAP 6 and web applications to use Kerberos and SPNEGO for authentication and authorization.
The web application security domain must be configured to support a fallback login mechanism. This requires the following steps:
- Add a new security domain to server as a fallback authentication method.
- Add a usernamePasswordDomain module option to the web application security domain that points to the fallback domain.
Example Security Domain Configured with a Fallback Security Domain
3.1.3. 3. Add the Login and Error Pages 复制链接链接已复制到粘贴板!
To use FORM login, a login and error page are required. These files are added to web application and are used in the authentication process.
Example login.jsp file:
Example error.jsp file:
3.1.4. 4. Modify the web.xml 复制链接链接已复制到粘贴板!
After adding the login and error pages to the web application, the web.xml must be updated to use these files for FORM login. A <form-login-config> element is added to <login-config> and the paths to the the login and error pages are specified as <form-login-page> and <form-error-page> elements.
Example updated web.xml file:
3.2. Securing the Management Interfaces with Kerberos 复制链接链接已复制到粘贴板!
In addition to providing Kerberos authentication in security domains, JBoss EAP 6 also provides the ability to secure the management interfaces using Kerberos. To enable Kerberos authentication on the management interfaces, the following steps must be performed:
The CLI commands shown below were done assuming a standalone instance of JBoss EAP 6. For more details on using the CLI with JBoss EAP 6 domains, please consult The Management CLI section of the Red Hat JBoss Enterprise Application Platform 6 Administration and Configuration Guide.
3.2.1. 1. Enable Relavant System Properties 复制链接链接已复制到粘贴板!
As discussed in a previous section, enable any needed JBoss EAP 6 system properties for connecting to the Kerberos server.
Before Kerberos authentication can be used in a security realm, a connection to a Kerberos server must be added. The following example shows how to add a Kerberos server identity to the existing Management Realm.
Example CLI for Adding a Server Identity to a Security Realm
/core-service=management/security-realm=ManagementRealm/server-identity=kerberos:add
/core-service=management/security-realm=ManagementRealm/server-identity=kerberos:add
/core-service=management/security-realm=ManagementRealm/server-identity=kerberos/ \ keytab=host\/testserver@MY_REALM:add( \ path=/home\/username\/service.keytab, \ debug=true)
/core-service=management/security-realm=ManagementRealm/server-identity=kerberos/ \
keytab=host\/testserver@MY_REALM:add( \
path=/home\/username\/service.keytab, \
debug=true)
reload
reload
Resulting XML
Once the Kerberos server identity has been properly configured, the authentication method in the security realm needs to be updated to use it.
Example CLI for Adding Kerberos Authentication to a Security Realm
/core-service=management/security-realm=ManagementRealm/authentication=kerberos:add
/core-service=management/security-realm=ManagementRealm/authentication=kerberos:add
reload
reload
Resulting XML