Social Connect v1.0

  • Hi Ben Borges

    If I understand your question correctly, this is the same problem that Tom had a couple of weeks ago.

    I have plans to make this a lot easier, but I just started a new job and am really busy at the moment, so can't tell you when I'll be able to release. For now a quick hack would be to change line 48 in start.php from this

    $proceed = elgg_trigger_plugin_hook('social_connect', 'user', $args, true);

    to this

    $proceed = elgg_trigger_plugin_hook('social_connect', 'user', $args, 'email');

    If you make this change, when the plugin finds the same email address in Elgg it will connect the profile and NOT create a new one anymore, which I think is what you wanted

    Regarding integration from the inside, it is totally possible, I have plans to make that available too, but same problem as before: I am working on this in my free time, of which I don't have much at the moment :-(

  • Hi Federico,

    Thank you for providing this awesome plugin!

    I had a trouble with this plugin.

    My elgg web site was collapsed when this plugin enabled.

    I found the cause is short-open-tag '<?' in the views/default/social_connect/connect.php and my server 'short_open_tag' disabled.

    It would be much appreciated if you could use '<?php' instead of '<?' for next release.



  • Thanks a lot for taking the time to answer privately and public, thanks for your support, i'm wathing this plugin and will be ready to test it when you release those changes, in the meantime i will apply your fix. 
    thanks again 

  • Hi Koji Ohno,

    Thanks for your feedback. I have already changed it in github, so the next version should not have any more short tags anywhere.

    I'm glad you like the plugin. Please do recommend it by clicking on the Recommend button at the top of this page :-)

  • I'm using Elgg 1.8.8 and all the requirements are OK. This plugin complains about an authentication error when I try to login or register with gmail. I don't understand what is the "JavaScript origins:" field. I've just put my domain there like in the example. 

    What is this in the instructions???

    Configuration & Usage


    1. <?php
    2. $config = array(
    3. "base_url" => "",
    4. "providers" => array (
    5. "Google" => array (
    6. "enabled" => true,
    7. "keys" => array ( "id" => "PUT_YOURS_HERE", "secret" => "PUT_YOURS_HERE" ),
    8. "scope" => "" .
    9. "", // optional
    10. "access_type" => "offline", // optional
    11. "approval_prompt" => "force" // optional
    12. )));
    13. require_once( "/path/to/hybridauth/Hybrid/Auth.php" );
    14. $hybridauth = new Hybrid_Auth( $config );
    15. $adapter = $hybridauth->authenticate( "Google" );
    16. $user_profile = $adapter->getUserProfile();

    Am I supposed to paste it somewhere? Couldn't find anything like that in the files.
  • Very nice plugin, it is working fine after some special changes.

    1. Google Backlink must be https://***/mod/social_connect/index.php?hauth.done=Google
    2. Add this in social_connect_public_pages array:

    Hope you will at this in your git.


  • Hi Dominion,

    Thanks for your feedback.

    I'm working on version 1.1 for some basic bug fixing and improvements, and your changes are all there. The only thing I would say is that point number 2 (the public pages) isn't really the job of this plugin I think. In version 1.1 the plugin will define its own public pages for what it adds itself, but the rest should be done by the corresponding plugins. Do you see what I mean?

  • Okay but without your plugin all three public pages are clickable in walled garden mode.

    Further "uservalidationbyemail" wasn't reachable after activating your plugin, I add it to the array too.

  • I see! I would expect the walled garden to work in exactly the same way as it does without this plugin. I need to investigate this one. I don't really have an answer for now, other than adding the pages as you did.

  • Something gonna wrong since some hours.
    I have nothing changed, also a new Facebook App ID & Secret won't work.

    If I try to login via facebook I get this error message.
    What could it be?


    Something bad happen!

     Authentification failed. The user has canceled the authentication or the provider refused the connection.
  • Hi Dominion,

    If you create a directory called log with a file called debug.log inside your Social Connect installation (like /mod/social_connect/log/debug.log), you can then enable the test mode from the plugin settings and look at what the log has to say.

    The next version will create the file automatically and let you choose where to put it and the log level. For now you have to do this automatically...

    The log should help you understand where the problem is, I hope ;-)

  • Okay, I'll get this error messages.
    I have already tried another facebook account, but it not realy helps.

    Found this issue on github:

    ERROR -- ********** -- 2012-11-30T10:58:39+01:00 -- Exception:Authentification failed! Facebook returned an invalide user id. -- Exception Object

    ERROR -- ********** -- 2012-11-30T10:58:39+01:00 -- Hybrid_Auth initialize: A stored Error found, Throw an new Exception and delete it from the store: Error#5, 'Authentification failed! Facebook returned an invalide user id.' --


    Did you have any ideas?

  • Hi Darth Vader,

    Sorry, I missed your comment before. You do not need that setup, it's all done by the plugin.

  • Hi Dominion,

    Can you paste your log file and configuration in a PM so I can have a look at it? Otherwise it's difficult to know what's going on...

  • I have released version 1.1 of Social Connect - the plugin now works in a walled garden, you can set the log level and file name, a new option in the settings allows you to select the default response for the social_connect,user hook, the settings page is tidier and less cluttered. Please upgrade to new version if you can and report any issues you find in the comments to the new release! Note that the plugin folder is now called 'social-connect' instead of 'social_connect'...

  • hello.

    i need authentication throw I didn't find anything like this.

    can you help me??? and integrate it to your awesome plugin???

    or maybe someone solved this problem?

  • I have 2 questions:

    1.) Is it possible to migrate a user from "social connect" to an "real" registered user in elgg?

    2.) My system only runs on https behind an firewall. The user access from outside using firewall port 11223, where the firewall redirects (using NAT) to the internal elggserver listening on port 443. The elgg system works fine, but social connect does not redirect back to the elgg page after logged in on goolge or yahoo (for example). The social-connect only works on port 443.


  • Migrating is definitely a good idea. Imagine using Facebook social connect whenever you enter other sites. Facebook would know where else you're going online and how often.

    Besides, if Facebook starts losing members to the smaller independent networks, why would the smaller networks continue promoting it with the social connect buttons. If we all use social connect, Facebook will shift from a network of people to a network of networks, worse scenario than we have now. 

    What would be really cool is if we have a social connect option for the smaller elgg sites so that if you join one elgg site, you could use the same login info for other elgg sites. Promote the smaller networks and not Facebook or Google+ :)

  • @ Libertarian You are right. Elgg is for small networks and if I am not wrong, small networks can rapidly make a giant network with longivity. I and Twizanex team have been thinking about this for some time and I hope to see Elgg social connect API login button soon. But for now I am working on Elgg sites Ads or banners Plugin that will help Elgg sites networks to be even more powerful on serving banners or ads just like Facebook but in a simple way that even a third grader can upload banners  on Elgg sites easily. The trick is making it simple and user friendly and people will drive it...

  • .
    @Tom - what size numbers is 'small' elgg
    We talk later abt....
    My elggucationally federated social networks
    Ed Predates multi-sites, but not multi sites,
    More like my distributed elgg....

  • Ps:

    The 'migrate' almost missed me !
    But same rationale applies...

  • By using “small” network, I mean Elgg sites with members ranging from 20 members to 50 million members or more but hosted by different companies and managed by individual Admins.

    Big social network companies spend millions of dollars on branding. However, the Elgg social media network revolution has totally changed the way small and successful social networks  “Elgg Admins”  and their members interact with other Elgg site members  and  this kind of networking can reach out to even new online members that Facebook, twitter, and other major social networks cannot reach or even attract.  The more the people are bombarded with technology the more people want to go back to Clan structured social networks—I mean, small and a likeminded member’s groups or community.  And Elgg being a social network engine has played a major role to small business and it is true that more business owners  are now using Elgg to;  increase their business site traffic,  create a brand for their Business, to reward their customers with  free gifts and discounts, to make it easier to generate income through coupons and buzz, to bring in new members with geolocation to their shopping cart sites,  and last but not least to connect with other businesses at a speed of light than popular social networks on earth.

  • One more question: could there by an security issue by using this social connect plugin? I mean the following thing:

    the social network, like google or facebook (or whatever) has "the power" to log in an user to my elgg installation.
    Lets think about an situation, where those networks could be evil - could those network use bots to login to an elgg installation with active "social connect" plugin in order to scan/parse/index an elgg community?

    Could those social connect abuse the "social connect" feature to access an "closed" elgg installation?


  • Facebook has a list of the emerging baby networks because we willingly give them our site urls when we sign up for the API keys. Are they evil? Any entity to which you are a commodity is as benevolent to you as the farmer is to the sheep.  

    Facebook is increasingly censoring individuals (simply create a FB account, start adding some friends and you'll see what I mean) and empowering their corporate sponsors to beat us over the head with ads (they even sneak in ads inbetween my friends' posts when I scroll down the startpage from my phone now). Billy posted this. Bobby posted that. Sponsor you might like: THE POLICE. Like the police.

    No joke, I took a screenshot of it. Just wait till FB starts inserting ads into the connect option too.

    Facebook gets tax breaks and financial presents from the government in return for spying services. Instead of going for Facebook theme this and social connect that, I will be ignoring Facebook out of existence.

    I am providing a service for my users. Why should I want this proceeding to go through Facebook?

    My site is not Facebook. I don't want it to look like Facebook. It's something different. It's something better. If you don't like it, it's fine. And if you don't like in on FB, even more so.

    Cool plugin. It works. Worth using? No, thanks.

    Long post. Sorry Dhrup :)


  • @ Libertarian You are 100% right. That is why we have started using different names in most plugins and not  Facebook this... Facebook that... facebook here... facebook there.... On the Ads topic, Elgg need their own ads system and Elgg sites should not be used by Major sites as a Junkyard for Salvage Ads. Elgg sites are unique and should remain so... That is why I and twizanex team we are  working on a Elgg Ad Plugin that will work just like Facebook but plugin for Elgg Sites. Currently the plugin is working fine but it is going through some vigorous testing before it will be available. It is high time Elgg sites owners start generating their own income from Elgg site Ads managed and operated by members so that they can maintain their sites or even improve their hosting plans...


Developer in PHP, iOS, Java, Android ~ Enjoys synchronised swimming as a hobby


  • Category: Authentication
  • License: GNU General Public License (GPL) version 2
  • Updated: 2014-11-17
  • Downloads: 7356
  • Recommendations: 25

Other Projects

View Federico's plugins