Saturday 1 August 2015

How to enable security in ADF application

This blog we will see how to enable security in ADF application.

To enable the security we need to follow the below steps
1. Create entity, view and application module in model project. Create a page for which after successfully login the application it will navigate the same page.
2. Now from the Application menu, choose Secure>Configure ADF Security.
3. In the ADF Security page, leave the default ADF Authentication and Authorization option selected. Click Next.
4. In the Authentication Type page> select the authentication type that you want your application to use when the user submits their login information. Click Next.
5. Select Form-based Authentication, you can also select Generate Default Pages to allow the wizard to generate a default login and error page.
6. In the Automatic Policy Grants page, leave the default No Automatic Grants option selected. Click Next.
7. In the Authenticated Welcome page, select Redirect Upon Successful Authentication to direct the user to a specific web page after they log in. Click Next. Then Finish.
8. Now we need to create the application role, to define the group of users with the same view permission rights. Choose Secure>Application Roles from the Application menu in the JDeveloper.
9. Select Add New Role in the Application Roles tab. Provide the name for Role (eg: Admin). When you add an application role to the policy store, JDeveloper updates the jazn-data.xml file located in the src/META-INF folder relative to the application workspace.
10. Add users to the newly created Roles.
11. Create the User and select the check box. Click OK.
12. Grant public access to ADF security.
In the Resource Grants overview editor, click one of the following Resource Type :
• Task Flows, when you want to make a bounded task flow public. The application displays the web pages under the permission you define for the task flow itself. Thus, all constituent web pages of the bounded task flow will become public.
• Web Pages, when you want to make individual web pages public. Typically, these pages are defined by an unbounded task flow and are top-level pages in the application, such as a home page.
13. Run the Application module it will ask for user name and password.
14. Run the application it will ask for user name and password.
You Can download the code: Download

Thanks..