Deploying an ADF Secure Application using WLS Console

Posted by juan.ruiz on Oracle Blogs See other posts from Oracle Blogs or by juan.ruiz
Published on Mon, 07 Jun 2010 19:32:29 -0800 Indexed on 2010/06/08 3:53 UTC
Read the original article Hit count: 589

Last week I worked on a requirement from a customer that wanted to understand how to deploy to WLS an application with ADF Security without using JDeveloper. The main question was, what steps where needed in order to set up Enterprise Roles, Security Policies and Application Credentials. In this entry I will explain the steps taken using JDeveloper 11.1.1.2. 0

Requirements:

Instead of building a sample application from scratch, we can use Andrejus 's sample application that contains all the security pieces that we need.

Open and migrate the project. Also make sure you adjust the database settings accordingly.

Creating the EAR file

Review the Security settings of the application by going into the Application -> Secure menu and see that there are two enterprise roles as well as the ADF Policies enforcing security on the main page.

Make sure the Application Module uses the Data Source instead of JDBC URL for its connection type, also take note of the data source name - in my case I have:

java:comp/env/jdbc/HrDS

To facilitate the access to this application once we deploy it. Go to your ViewController project properties select the Java EE Application category and give it a meaningful name to the context root as well to the Application Name

image

Go to the ADFSecurityWL Application properties -> Deployment  and create a new EAR deployment profile. Uncheck the Auto generate and Synchronize weblogic-jdbc.xml Descriptors During Deployment

image

Deploy the application as an EAR file.

Deploying the Application to WLS using the WLS Console

On the WLS console create a JNDI data source. This is the part that I found more tricky of the hole exercise given that the name should match the AM's data source name, however the naming convention that worked for me was

jdbc.HrDS

Now, deploy the application manually by selecting deployments ->Install look for the EAR and follow the default steps.

If this is the firs time you deploy the application, once the deployment finishes you will be asked to Activate Changes on the domain, these changes contain all the security policies and application roles insertion into the WLS instance.

image

Creating Roles and User Groups for the Application

To finish the after-deployment set up, we need to create the groups that are the equivalent of the Enterprise Roles of ADF Security.

imageFor our sample we have two Enterprise Roles employeesApplication and managersApplication. After that, we create the application users and assign them into their respective groups.

Now we can run the application and test the security constraints

image

© Oracle Blogs or respective owner

Related posts about adf

Related posts about deploy