title: Facebook login not working in Liferay 6.2
body: <p>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.</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>Reference code:</p>
  
  <pre><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('&lt;%= HtmlUtil.escape(emailAddress) %&gt;', &lt;%= anonymousAccount %&gt;);
    if (&lt;%= !anonymousAccount %&gt;) {         
            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('&lt;%= HtmlUtil.escape(emailAddress) %&gt;', &lt;%= anonymousAccount %&gt;);
     if (&lt;%= !anonymousAccount %&gt;) {
          Liferay.fire(
             'closeWindow',
            {
               id: namespace + "signInDialog"
             }
         );
     }
  }
  </code></pre>
  
  <p>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. </p>
  
  <p>Thanks</p>