Topic-icon Issues with Google and Twitter authentication

Active Subscriptions:

None
Facebook authentication works fine with Joomla/JomSocial, but both Google and twitter has issues.

Google gives this error "Cannot use a stream transport when fopen() is not available or "allow_url_fopen" is disabled." We have fopen disabled for security reasons. Is there anyway to use curl instead?

For Twitter, it is not auto logging in users when signed up for the first time. It always redirects to the registration page. How to enable Twitter to auto login similar to Facebook?
The topic has been locked.
Support Specialist
7 years 8 months ago #59135 by alzander

For Twitter, it is not auto logging in users when signed up for the first time. It always redirects to the registration page. How to enable Twitter to auto login similar to Facebook?

This isn't possible. Twitter does not return the user's email address so JFBConnect has to take the user through a mini-registration process. In the JFBConnect configuration area, you can disable other fields (name, password, username) so that the registration only asks for the user's email address while the other details are imported or automatically generated. The user will need to go through some flow to get their email address though.

Google gives this error "Cannot use a stream transport when fopen() is not available or "allow_url_fopen" is disabled." We have fopen disabled for security reasons. Is there anyway to use curl instead?

JFBConnect always tries to instantiate cURL for authentication. The other transport options have many issues, as you're seeing. Can you try setting the "Enable Debug Mode" option in the JFBConnect -> Configuration area to 'Yes'. That may display more details as to why cURL isn't being used or other errors that may be occurring during the authentication process.

Thanks,
Ale
The topic has been locked.
Active Subscriptions:

None
7 years 8 months ago #59173 by yasmagic
Thank you. We are still troubleshooting cURL issue.

The FB related JavaScript code seem to have been repeated in all internal web pages after login. This should appear only on the logon page, and should disappear after user is loggeded in. What do I need to do to make this happen?

Thanks!
The topic has been locked.
Support Specialist
7 years 8 months ago #59191 by alzander
Which Facebook Javascript code are you talking about the? The sdk.js file? Currently, we still leave that enabled on all pages as many of our other features rely on that code being present. I don't have an immediate suggestion on how to remove it. If it's critical, I'm sure we can help you make a minor code change which should prevent the code from being inserted if the user has logged in, but you'd need to test a lot to make sure it doesn't introduce other issues.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
7 years 7 months ago #59209 by yasmagic
Thanks Alex. This code repeats in all pages. We want to remove it after login if possible.

<script type="text/javascript">

window.fbAsyncInit = function() {
FB.init({version: 'v2.3',appId: '1XXXXX', status: false, cookie: true, xfbml: false});
FB.Event.subscribe('comment.create', jfbc.social.facebook.comment.create);
FB.Event.subscribe('comment.remove', jfbc.social.facebook.comment.remove);
FB.Event.subscribe('edge.create', jfbc.social.facebook.like.create);
FB.Event.subscribe('edge.remove', jfbc.social.facebook.like.remove);
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_GB/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
The topic has been locked.
Support Specialist
7 years 7 months ago #59216 by alzander
Here's what I'd recommend trying:
1) Edit /components/com_jfbconnect/libraries/provider/facebook.php
2) Around line 301, you'll see:
public function onAfterRender()
    {
Right after that, add:
if (! (JFactory::getUser()->guest) )
   return;

That little bit of code will simply check if the user is logged in, in any way (Joomla credentials or any social network). If logged in, then all of the Facebook Javascript will not be inserted into page.

Some features that will no longer work for authenticated users if you remove that Javascript are:
* Email notification on new Facebook Comments
* Email notification on new Facebook Likes
* Connecting an existing account to Facebook

Please test and let us know how that goes. We'd really like to hear your feedback.

Alex
The topic has been locked.