Topic-icon SC Login Button missing FB scope

Active Subscriptions:

None
I was experiencing a load of problems while trying to map FB users to Joomla users via the "connect" button on SC Login.

After a while I notice it was missing the scope atribute.

So, I edited the mod_sclogin/helper.php file, around line 336 (function getJFBCConnectButton):

Changed
$buttonHtml .= '' . JText::_('MOD_SCLOGIN_CONNECT_BUTTON') .'';

to
$buttonHtml .= '' . JText::_('MOD_SCLOGIN_CONNECT_BUTTON') .'';

As you can seen its a quick patch, since to be properly done one should read the required scope from FBJConnect settings - I just typed in the ones I need :) .

But now I got it working :)
The topic has been locked.
Support Specialist
13 years 3 months ago #31584 by alzander
Alexandre,
Thanks for pointing that out. It's really mainly an issue for you since you're importing during the 'connection', which isn't something we currently do in JFBConnect. However, we will be implementing that soon.

The proper way to get the full scope params is:
$perms = JFBConnectProfileLibrary::getRequiredScope();
        if ($perms != "")
            $perms = 'data-scope="' . $perms . '"'; // OAuth2 calls them 'scope'
That will return the actual parameter you should add to the login-button tag, so it just looks like:
$perms = JFBConnectProfileLibrary::getRequiredScope();
        if ($perms != "")
            $perms = 'data-scope="' . $perms . '"'; // OAuth2 calls them 'scope'
        $buttonHtml .= '<div class="fb-login-button" onlogin="javascript:jfbc.login.on_login();" '.$perms. '>' . JText::_('MOD_SCLOGIN_CONNECT_BUTTON') .'</div>';

Hope that helps!
Alex
The topic has been locked.