03.05.2015 Views

IBM WebSphere V5.0 Security - CGISecurity

IBM WebSphere V5.0 Security - CGISecurity

IBM WebSphere V5.0 Security - CGISecurity

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3.3 J2EE Container-based security<br />

J2EE Containers are responsible for enforcing access control on component<br />

objects and methods. Containers provide two types of security:<br />

► Declarative security<br />

► Programmatic security<br />

3.3.1 Declarative security<br />

Declarative security is the means by which an application’s security policies can<br />

be expressed externally to the application code. At application assembly time,<br />

security policies are defined in an application’s deployment descriptor. A<br />

deployment descriptor is an XML file which includes a representation of an<br />

application’s security requirements, including the application’s security roles,<br />

access control, and authentication requirements.<br />

When using declarative security, application developers are free to write<br />

component methods that are completely unaware of security. By making<br />

changes to the deployment descriptor, an application’s security environment can<br />

be radically changed without requiring any changes in application code.<br />

3.3.2 Programmatic security<br />

Programmatic security is used when an application must be “security aware”. For<br />

instance, a method might need to know the identity of the caller for logging<br />

purposes, or it might perform additional actions based on the caller’s role. The<br />

J2EE Specification provides an API which includes methods for determining both<br />

the caller’s identity and the caller’s role.<br />

The EJB methods are:<br />

► isCallerInRole<br />

► getCallerPrincipal<br />

The HttpServlet methods are:<br />

► isUserInRole<br />

► getUserPrincipal<br />

The use of these methods will be discussed in Chapter 8, “Programmatic<br />

security” on page 179.<br />

Chapter 3. J2EE application security 25

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

Saved successfully!

Ooh no, something went wrong!