Facebook authentication problem

Rate this topic: Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.
GK User
Fri Apr 18, 2014 5:21 am
Reply with quote
Report this post
Hello. I have a problem with joomla's "News 2" template: Facebook authentication it's not working. I've set it up the Authentication-Facebook plugin with my Facebook aplication data (Facebook API app ID & Facebook API secret). Other modules are working just fine with that data. Also, in the template's configuration (Social API tab) I've set the ID of a Facebook page in wich I'm an administrator.

Any idea of which may be the problem?
http://wilgnuts.com.ar/sanjose365

Thanks in advance.
User avatar
Fresh Boarder

GK User
Fri Apr 18, 2014 6:32 pm
Reply with quote
Report this post
Hello,

As I see you are not using our login with facebook on your website.
User avatar
Administrator

GK User
Sat Apr 19, 2014 4:30 am
Reply with quote
Report this post
dziudek wrote:Hello,

As I see you are not using our login with facebook on your website.


Now I did a fresh installation.
Image

Configuration:
Image
Image

Facebook APP:
Image
Image

Thanks!
User avatar
Fresh Boarder

GK User
Sat Apr 19, 2014 5:18 am
Reply with quote
Report this post
I've find out that from this URL: http://wilgnuts.com.ar/sanjose365/index ... =blankpage the login button doesn't work at all. If I delete the last part of the URL (&tmpl=blankpage) the button works perfectly. There will be some way to fix it and make it work with "&tmpl=blankpage"?
User avatar
Fresh Boarder

GK User
Sat Apr 19, 2014 2:23 pm
Reply with quote
Report this post
Please try in the blankpage.php file before closing body tag the following code:

Code: Select all
<div id="gkfb-root"></div>
<script type="text/javascript">
//<![CDATA[
      window.fbAsyncInit = function() {
      FB.init({ appId: 'FB_API_PUBLIC_KEY',
         status: true,
         cookie: true,
         xfbml: true,
         oauth: true
      });
            
        function updateButton(response) {
          var button = document.getElementById('fb-auth');
      
         if(button) {   
             if (response.authResponse) {
             // user is already logged in and connected
             button.onclick = function() {
                 if(document.id('login-form')){
                     document.id('modlgn-username').set('value','Facebook');
                     document.id('modlgn-passwd').set('value','Facebook');
                     document.id('login-form').submit();
                 } else if(document.id('com-login-form')) {
                    document.id('username').set('value','Facebook');
                    document.id('password').set('value','Facebook');
                    document.id('com-login-form').submit();
                 }
             }
         } else {
             //user is not connected to your app or logged out
             button.onclick = function() {
                 FB.login(function(response) {
                    if (response.authResponse) {
                       if(document.id('login-form')){
                         document.id('modlgn-username').set('value','Facebook');
                         document.id('modlgn-passwd').set('value','Facebook');
                         document.id('login-form').submit();
                       } else if(document.id('com-login-form')) {
                          document.id('username').set('value','Facebook');
                          document.id('password').set('value','Facebook');
                          document.id('com-login-form').submit();
                       }
                   } else {
                     //user cancelled login or did not grant authorization
                   }
                 }, {scope:'email'});   
             }
          }
       }
     }
     // run once with current status and whenever the status changes
     FB.getLoginStatus(updateButton);
     FB.Event.subscribe('auth.statusChange', updateButton);   
   };
    //     
   window.addEvent('load', function(){
        (function(){
                if(!document.getElementById('fb-root')) {
                     var root = document.createElement('div');
                     root.id = 'fb-root';
                     document.getElementById('gkfb-root').appendChild(root);
                     var e = document.createElement('script');
                 e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
                     e.async = true;
                 document.getElementById('fb-root').appendChild(e);   
                }
        }());
    });
    //]]>
</script>


Please remember to replace the FB_API_PUBLIC_KEY with your app public key.
User avatar
Administrator

GK User
Sat Apr 19, 2014 8:22 pm
Reply with quote
Report this post
I added the lines of code to blankpage.php file with my Api Puclic Ket, but still not working :(
User avatar
Fresh Boarder

GK User
Mon Apr 21, 2014 2:50 pm
Reply with quote
Report this post
Hi,
I have the same problem, too. (tested with News2 3.11.0, 3.11.3 + Jommla 2.5 and 3.2 and Newas2-Quickstrat)

It seams that the fb scripts in blankpage are not loaded. :(
User avatar
Fresh Boarder

GK User
Tue Apr 22, 2014 8:38 am
Reply with quote
Report this post
@Zienkiewicz - did you tried to add the mentioned code with your API key?
User avatar
Administrator

GK User
Tue Apr 22, 2014 9:02 am
Reply with quote
Report this post
yes, I did. but unfortunately without success :(
User avatar
Fresh Boarder


cron