Adding JAAS authentication to an enterprise application targeted for a WAS
The Java™ Authentication and Authorization Service (JAAS) version 1.0 extends the Java 2 Security Architecture of the Java 2 Platform with additional support for authentication and for enforcing access control upon users. The development environment supports the JAAS architecture and extends the access control architecture to support role-based authorization for J2EE resources including servlet, JSP, and EJB components. JAAS maps an authenticated WebSphere® Application Server user identity to a set of user authentication data (user ID and password) for a specified back-end Enterprise Information System (EIS).
Prerequisite
- Create an enterprise application and target the server to a WAS v6.0, or later.
To add JAAS authentication use the WAS Deployment editor by completing the following steps:
- Switch to the Java EE perspective.
- The location of the WAS Deployment editor depends on the specification-level of your enterprise application project:
- If your enterprise application (EAR) project is at 1.2, 1.3 or 1.4 specification-level, complete the following steps:
- In the Enterprise Explorer view, expand your enterprise application project folder.
- Under the enterprise application project folder for which you want add or edit server configurations, double-click the
Deployment Descriptor to open the Application Deployment Descriptor editor.
- Select the
Deployment tab at the bottom of the editor.
Restriction: Before adding or removing J2EE modules, using the
Module page in the Application Deployment Descriptor editor, first click the
Deployment tab to activate the functions in the deployment page. Then add or remove your modules from the Module page. You need to complete this task for each Application Deployment Descriptor editor session that you want to add or remove modules from the Module page.
- If your enterprise application (EAR) project is at 5.0 specification-level, complete the following steps:
- In the Enterprise Explorer view, right-click your enterprise application project folder.
- Select
Java EE | Open WAS Deployment.
- Expand the Authentication section.
- Click the
Add button beside the JAAS authentication entries list table. The Add JAAS Authentication Entry dialog box opens.
- In the dialog box, fill in an alias, user id, password, and description for the authentication entry. For example, you could enter the alias, DB2® user id, and DB2 password to access a DB2 database. For more information about any of the fields on this dialog box, select the field and then press
F1. Click OK.
- Save your changes and close the editor. A JAAS authentication alias has been added to the deployment descriptor files.