Use these steps to access the agent sample application and test the policies.
Access http://ProtectedResource-1.example.com:1081/agentsample/index.html, the sample application URL, from a web browser.
The Sample Application welcome page is displayed.
Click the J2EE Declarative Security link.
On the resulting page, click Invoke the Protected Servlet.
You are redirected to the Access Manager login page.
Log in to the Access Manager console as testuser1.
testuser1
password
If you can successfully log in as testuser1 and the J2EE Policy Agent Sample Application page is displayed, this first part of the test has succeeded and authentication is working as expected.
Click the J2EE Declarative Security link to go back.
On the resulting page, click Invoke the Protected Servlet.
If the Success Invocation message is displayed, this second part of the test has succeeded as the sample policy for the manager role has been enforced as expected.
Click the J2EE Declarative Security link to go back.
On the resulting page, click Invoke the Protected EJB via an Unprotected Servlet.
If the Failed Invocation message is displayed, this third part of the test succeeded as the sample policy for the employee role has been enforced as expected.
Log out and close the browser.
In a new browser session, go to http://ProtectedResource-1.example.com:1081/agentsample/index.html, the sample application URL.
You are redirected to the Access Manager login page.
Log in to the Access Manager console as testuser2.
testuser2
password
The Failed Invocation message is displayed. This is a known issue.
Click the J2EE Declarative Security link.
On the resulting page, click Invoke the Protected EJB via an Unprotected Servlet.
The Successful Invocation message is displayed. The sample policy for the employee role has been enforced as expected.
Click the J2EE Declarative Security link to go back.
On the resulting page, click Invoke the Protected Servlet.
If the Access to Requested Resource Denied message is displayed, this part of the test is successful as the sample policy for the manager role has been enforced as expected.
Log out and close the browser.