29.01.2013 Views

WebSphere Application Server - IBM Redbooks

WebSphere Application Server - IBM Redbooks

WebSphere Application Server - IBM Redbooks

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2. Define roles to represent a logical grouping of users. Example roles would be<br />

Customer, Administrator, Operator. Roles are defined in both the Web<br />

deployment descriptor and EAR deployment descriptor.<br />

3. Define constraints to protect servlet and JSP HTTP methods by role. This is<br />

done in the Web deployment descriptor.<br />

4. Assign users or groups to roles. Real users and groups defined to the<br />

operating system must be associated to the roles defined in the application.<br />

This is done in the enterprise application deployment descriptor.<br />

5. Enable <strong>WebSphere</strong> global security. <strong>WebSphere</strong> global security must be<br />

enabled to activate the role-based security checking. This is done in the<br />

server configuration.<br />

Example: Securing a JSP<br />

As an example, let us take the Online Catalog application and introduce security<br />

measures. It is easy to see several logical roles that could be used, for example,<br />

shoppers, catalog administrators, and order department.<br />

Note: In this example we are actually adding a second layer to the our<br />

application security. The first layer is programmed using the login servlet. To<br />

get past that checkpoint, they need to know the user ID and password stored<br />

in the application database (admin/admin). This method was used to illustrate<br />

a simple login procedure based on information stored in a user database and<br />

is not related to <strong>WebSphere</strong> security.<br />

In the second layer of security we are going to ignore this first login and secure<br />

the application at the JSP level using J2EE role-based security.<br />

The process will consist of:<br />

1. Defining the role.<br />

2. Defining a constraint.<br />

3. Assigning the role to the constraint.<br />

4. Identifying the authentication method and the realm.<br />

5. Defining the roles to the enterprise application.<br />

6. Identifying real users defined to the local operating system that have the<br />

CatalogAdmin role.<br />

7. Enabling global security on Express <strong>Application</strong> <strong>Server</strong>.<br />

Figure 16-3 on page 559 shows an overview of the security settings for an<br />

application and their relation to each other.<br />

558 <strong>IBM</strong> <strong>WebSphere</strong> <strong>Application</strong> <strong>Server</strong> - Express V5.0.2 Developer Handbook

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!