1
votes

We are using liferay-portal-6.2-ce-ga2 community edition. We are trying to integrate facebook login in our portal, but it is not working properly. Users are added/updated successfully with the information obtained from facebook in the com.liferay.portlet.login.action.FacebookConnectAction but when the redirect is sent from login_redirect.jsp it redirects user to login page of the portal instead of logging in the user.

On debugging login_redirect.jsp we found out that control is going into the if part (in the code snippet below) and it is trying to invoke afterlogin method.

But the afterlogin method is not found present in the loaded javascript. Neither we could find this method anywhere except /portal-master/portal-web/docroot/html/taglib/ui/discussion/page.jsp. But this does not look relevant.

Reference code:

if (window.opener) {
 [color=#cc1f1f]    
  var namespace = window.opener.parent.namespace;
  var randomNamespace = window.opener.parent.randomNamespace;
  var afterLogin = window.opener.parent[randomNamespace + 'afterLogin'];[/color]

  afterLogin('<%= HtmlUtil.escape(emailAddress) %>', <%= anonymousAccount %>);
  if (<%= !anonymousAccount %>) {         
          window.opener.parent.Liferay.fire(
          'closeWindow',
          {
                    id: namespace + “signInDialog"
           }
         );
            window.close();
        }

}
else {
   var namespace = window.parent.namespace;
   var randomNamespace = window.parent.randomNamespace;
   var afterLogin = window.parent[randomNamespace + 'afterLogin'];
   afterLogin('<%= HtmlUtil.escape(emailAddress) %>', <%= anonymousAccount %>);
   if (<%= !anonymousAccount %>) {
        Liferay.fire(
           'closeWindow',
          {
             id: namespace + "signInDialog"
           }
       );
   }
}

Same issue is occurring for Google+ and Linked In login as they also use the same redirection login. Please suggest what we are missing or if this is already a known issue in Liferay.

Thanks

1
For this you have to create the hook over facebookStrutsAction.javaPranoti

1 Answers

2
votes

Try this:

  1. Login Liferay with admin access.
  2. Go to control panel->configuration->portal settings-> aithentication.
  3. Under the facebook tab, Don't enable Verified account required .
  4. Set Redirect URl as http:// your portal URL/c/login/facebook_connect_oauth
  5. Save Changes and sign out.
  6. At the facebook side: I guess you are already a developer and have done the settings correctly.If not then go through this .
  7. Now Use the option Facebook to login in your Liferay.