10.12.2012 Views

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

FIGURE 28–5 Invoking an Enterprise Bean Business Method<br />

Web Client<br />

<strong>The</strong> EJB container is responsible for enforcing access control on the enterprise bean method. It<br />

consults the security policy (derived from the deployment descriptor) associated with the<br />

enterprise bean to determine the security roles that are permitted access to the method. For<br />

each role, the EJB container uses the security context associated with the call to determine if it<br />

can map the caller to the role.<br />

<strong>The</strong> container’s evaluation stops with an “is authorized” outcome when the container is able to<br />

map the caller’s credential to a role. A “not authorized” outcome is reached if the container is<br />

unable to map the caller to any of the permitted roles. A “not authorized” result causes an<br />

exception to be thrown by the container, and propagated back to the calling JSP page.<br />

If the call is authorized, the container dispatches control to the enterprise bean method. <strong>The</strong><br />

result of the bean’s execution of the call is returned to the JSP, and ultimately to the user by the<br />

web server and the web client.<br />

Read Chapter 29, “Securing <strong>Java</strong> <strong>EE</strong> Applications,” for more information on protecting web<br />

applications.<br />

Security Functions<br />

Web Server<br />

credential JSP/servlet<br />

Object<br />

Session<br />

Context<br />

Security<br />

Context<br />

Credential used to<br />

establish security<br />

association<br />

Remote<br />

call<br />

EJB Container<br />

Security<br />

Context<br />

A properly implemented security mechanism will provide the following functionality:<br />

■ Prevent unauthorized access to application functions and business or personal data<br />

■ Hold system users accountable for operations they perform (non-repudiation)<br />

■ Protect a system from service interruptions and other breaches that affect quality of service<br />

Authorization<br />

Overview of <strong>Java</strong> <strong>EE</strong> Security<br />

Chapter 28 • Introduction to Security in the <strong>Java</strong> <strong>EE</strong> Platform 767<br />

EJB

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

Saved successfully!

Ooh no, something went wrong!