This is the simple authorization for my jspx pages by passing the parameter to my task flows using adf security.
This demo have been developed using jdeveloper 11.1.1.6.0.
In this demo i will show how to provide adf authentication by using paramter in Task flow.
Create a simple login page and validate the credentials using adf security.
Refer the link for adf security enabled login page
http://docs.oracle.com/cd/E14571_01/web.1111/b31974/adding_security.htm#BABDEICH
I have created 2 users.
=> testuser1 ---> Manager Role
=> testuser2 ---> user Role.
In my adfc-config.xml has welcome.jspx which calls a bounded task flow.
The task flow definition contains EmpDept.jspx in which i have dragged and dropped EmployeeVO as af:form.
In which the salary attribute should be shown for Manager Role users (testuser1 in our case).
i have created a bounded task flow in which i will be residing employees.jspx page. I have passed a parameter for this task flow.
Here am having the variable mode in which i will get the role of my user.
<af:commandButton text="Validate" id="cb2" action="go">
<af:setPropertyListener from="#{securityContext.userInRole['ManagerApplicationRole']==true}" to="#{pageFlowScope.mode}" type="action"/>
</af:commandButton>
In my command button i have set property listener which store the users tole to the mode variable.
Set the salary field rendered property #{pageFlowScope.mode}.
Now if we run our page
For testuser1
The welcome.jspx page renders after clicking Validate button the EmpDept.jspx page renders in which we can see Salary attribute in af:form
For testuser2
Now the salary attribute is hidden since the testuser2 doesnt contain ManagerRole.
Note:
This scenario can also be done in better way by passing #{securityContext.userInRole['ManagerApplicationRole']==true} directly to the rendered property of the salary attribute in af:form.
I just tried them passing through parameter and thought to share in blog.
This demo have been developed using jdeveloper 11.1.1.6.0.
In this demo i will show how to provide adf authentication by using paramter in Task flow.
Create a simple login page and validate the credentials using adf security.
Refer the link for adf security enabled login page
http://docs.oracle.com/cd/E14571_01/web.1111/b31974/adding_security.htm#BABDEICH
I have created 2 users.
=> testuser1 ---> Manager Role
=> testuser2 ---> user Role.
In my adfc-config.xml has welcome.jspx which calls a bounded task flow.
The task flow definition contains EmpDept.jspx in which i have dragged and dropped EmployeeVO as af:form.
In which the salary attribute should be shown for Manager Role users (testuser1 in our case).
i have created a bounded task flow in which i will be residing employees.jspx page. I have passed a parameter for this task flow.
Here am having the variable mode in which i will get the role of my user.
<af:commandButton text="Validate" id="cb2" action="go">
<af:setPropertyListener from="#{securityContext.userInRole['ManagerApplicationRole']==true}" to="#{pageFlowScope.mode}" type="action"/>
</af:commandButton>
In my command button i have set property listener which store the users tole to the mode variable.
Set the salary field rendered property #{pageFlowScope.mode}.
Now if we run our page
For testuser1
The welcome.jspx page renders after clicking Validate button the EmpDept.jspx page renders in which we can see Salary attribute in af:form
For testuser2
Now the salary attribute is hidden since the testuser2 doesnt contain ManagerRole.
Note:
This scenario can also be done in better way by passing #{securityContext.userInRole['ManagerApplicationRole']==true} directly to the rendered property of the salary attribute in af:form.
I just tried them passing through parameter and thought to share in blog.








No comments:
Post a Comment