When you generate new WebCenter 11g PS3 Portal Framework application in JDeveloper 11g, it creates login/logout pages and configures ADF Security. However, it generates basic login page, this can be improved by using new WebCenter 11g PS3 security login bean. With WebCenter 11g PS3, we have out of the box bean (o_w_s_l_LoginBackingBean), which can handle login/logout functionality without writing any custom code.
Download sample application - EnterprisePortalApp_v2.zip. Here you can see basic auto-generated login page structure for WebCenter 11g PS3 Portal Framework application:
I will reuse the same template for login page, but will change content structure. Will be using ADF Panel Form layout, username and password fields mapped with WebCenter login security bean, as well as ADF action button calling WebCenter login bean method for authentication:
Username field is mapped with o_w_s_l_LoginBackingBean userName property:
Password field is mapped with o_w_s_l_LoginBackingBean password property:
Action method for Login button is pointing to doLogin() method from o_w_s_l_LoginBackingBean:
Run portal application, will be redirected to Login page, login as redsam/welcome1 - o_w_s_l_LoginBackingBean will handle authentication process for you:
Authentication is successful - we are inside portal space:
If authentication process fails (wrong username/password, etc.), o_w_s_l_LoginBackingBean returns error message:
You may have valid question, how we could call required custom functionality, before o_w_s_l_LoginBackingBean login authentication method is invoked. Because login authentication is done by calling Action method, this means we could process before login logic from Action Listener method - let's create Action Listener method for the same Login button:
Inside Action Listener method, we can access both username and password values from o_w_s_l_LoginBackingBean, perform required actions and update (if needed) username and password values:
As you can see, for test purposes I'm changing username to scott. With current test case, when user provides username, for example - redsam:
Username will be changed to scott automatically, this user exists in ADF Security store as well:
Download sample application - EnterprisePortalApp_v2.zip. Here you can see basic auto-generated login page structure for WebCenter 11g PS3 Portal Framework application:
I will reuse the same template for login page, but will change content structure. Will be using ADF Panel Form layout, username and password fields mapped with WebCenter login security bean, as well as ADF action button calling WebCenter login bean method for authentication:
Username field is mapped with o_w_s_l_LoginBackingBean userName property:
Password field is mapped with o_w_s_l_LoginBackingBean password property:
Action method for Login button is pointing to doLogin() method from o_w_s_l_LoginBackingBean:
Run portal application, will be redirected to Login page, login as redsam/welcome1 - o_w_s_l_LoginBackingBean will handle authentication process for you:
Authentication is successful - we are inside portal space:
If authentication process fails (wrong username/password, etc.), o_w_s_l_LoginBackingBean returns error message:
You may have valid question, how we could call required custom functionality, before o_w_s_l_LoginBackingBean login authentication method is invoked. Because login authentication is done by calling Action method, this means we could process before login logic from Action Listener method - let's create Action Listener method for the same Login button:
Inside Action Listener method, we can access both username and password values from o_w_s_l_LoginBackingBean, perform required actions and update (if needed) username and password values:
As you can see, for test purposes I'm changing username to scott. With current test case, when user provides username, for example - redsam:
Username will be changed to scott automatically, this user exists in ADF Security store as well:











4 comments:
Hi Andrejus,
Thank you for the posts as being a noob in Oracle Webcenter Portal Application and ADF, I am facing a real hard time in understanding ADF and a WC Portal App.
To be true, I am completely new to both the technology.
If you could point to some documents on Webcenter application and adf either than that of Oracle itself, it would be of a great help to me.
Hi, Andrejus. Great blog - I have learned a lot from you!
I have an interesting dilemma that I hope you might have a minute to point me in the right direction.
I have a public 'home' page. On it, I have a login box (username, password, login button) that calls the doLogin action as you described. (Actually, using my own bean, since my app is just ADF, not a WC Portal app.)
It successfully logs the user in, but doesn't seem to follow the "action" and navigate to another page - it instead leaves the user on the public 'home' page.
Here's the source for the "login" button:
<af:commandButton text="Log In" id="cbLogin" action="page2" actionListener="#{loginBackingBean.doLogin}">
It calls loginBackingBean.doLogin and logs the user in, but doesn't then navigate to the "page2" action defined in my task flow.
Any pointers would be greatly appreciated!
Thanks,
Karl
Hi Karl,
I guess this post should help - http://andrejusb.blogspot.com/2010/11/things-you-must-know-about-adf-faces.html
Regards,
Andrejus
Hi Andrejus,
This post was very helpful. I need one help from you though. My requirement is, that a user should be able to register at the portal and at the end of the registration the user is automatically logged in to the application with the user name password. The users are getting created but not getting logged in automatically. The page goes back to the unathenticated home page.
When I login manually everything works fine. We are using the same o_w_s_l_LoginBackingBean to do this work.
Can you think of any reason why this may not be working?
Regards,
Mukund
Post a Comment