Java Reference
In-Depth Information
4. On the Connector Connection Pools page, click the name of the connection
pool for which you want to create a security map.
5. Click the Security Maps tab.
6. Click New to create a new security map for the connection pool.
7. Type a name by which you will refer to the security map, as well as the other
required information.
Click the Help button for more information on the individual options.
Configuring Security Using Deployment Descriptors
The recommended way to configure security in the Java EE 6 platform is with annotations.
If you wish to override the security settings at deployment time, you can use security ele-
ments in the web.xml deployment descriptor to do so. This section describes how to use
the deployment descriptor to specify basic authentication and to override default principal-
to-role mapping.
Specifying Security for Basic Authentication in the Deployment Descriptor
The elements of the deployment descriptor that add basic authentication to an example tell
the server or browser to perform the following tasks:
• Send a standard login dialog to collect user name and password data
• Verify that the user is authorized to access the application
• If authorized, display the servlet to the user
The following sample code shows the security elements for a deployment descriptor that
could be used in the example of basic authentication found in the tut-install /examples/
security/hello2_basicauth/ directory:
Click here to view code image
<security-constraint>
<display-name>SecurityConstraint</display-name>
<web-resource-collection>
<web-resource-name>WRCollection</web-resource-name>
<url-pattern>/greeting</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>TutorialUser</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
Search WWH ::




Custom Search