Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Redirecting to pages after successful authntication : ADF security

Sanjeeb MMay 21 2012 — edited May 22 2012
Hi All,
I have a use case as in i need to redirect to pages based on user roles after successful authentication.
In security configuration i have unchecked that option "Redirect on successful authentication" and in the doLogin method i am setting the loginURL to 2 different pages based on their roles.(right now i have hardcoded for testing purpose). Also i have assigned respective roles to the pages

if(role == "ADMIN"){
String loginUrl =
"/adfAuthentication?success-url=/faces/pages/AdminHomePage.jspx";
}
els if(role == "USER"){
String loginUrl =
"/adfAuthentication?success-url=/faces/pages/UserHomePage.jspx";
}
HttpServletResponse response =
(HttpServletResponse)ctx.getExternalContext().getResponse();
sendForward(request, response, loginUrl);

Though the code looks straight forward but redirection does not happen.After successful login the i see the same login page :(

Please suggest.

Thanks
Sanjeeb
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 19 2012
Added on May 21 2012
9 comments
5,676 views