1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

HybridAuth Social Login

Discussion in 'Plugin Suggestion Box' started by Graeme, May 5, 2013.

  1. Graeme

    Graeme Member

    HybridAuth, open source social sign on php library
    HybridAuth enable developers to easily build social applications to engage websites vistors and customers on a social level by implementing social signin, social sharing, users profiles, friends list, activities stream, status updates and more.

    I am trying to make a plugin right now for social login, using Hybridauth . At the moment I have managed to get it to register with any provider (facebook, google, twitter etc), and it stores their profile data into the hotaru users table. So it has created a full user in our database, but I am struggling to actually authenticate the user on the site. I'm having trouble with the sessions and passwords...not sure how to do this with hotaru.

    PHP:
     # 2 - if authentication exists in the database, then we set the user as connected and redirect him to his profile page
                     
    if( $authentication_info ){// what to use here?} 
    I've got my user in the database, and can confirm that they are there.. i am missing how to send them to their profile page, and actually have them logged in rather than just their details stored.
     
  2. Graeme

    Graeme Member

    Update: got this working now! just testing it. HybridAuth is a full social login - and it's open source! so we aren't tied down to any payment services (like the RPX plugin)...when a user registers via a social network, their details are stored in our database...happy days..i'm still learning learning php, so the code will need looking at, but it's all working well enough so far
     
  3. shibuya246

    shibuya246 Hotaru Developer Staff Member Admin

    If you load up your code somewhere on github I will take a look
     
    Graeme likes this.
  4. shibuya246

    shibuya246 Hotaru Developer Staff Member Admin


    Really nice to see people writing plugins.

    I will be organising a hotaruplugins website shortly where we can feature the latest and best of what is on offer.
     
  5. angolanmade

    angolanmade Well-Known Member

    This will be a great addition. Look forward to checking it out. MORE PLUGINS!!!!!!
     
    Graeme likes this.
  6. Graeme

    Graeme Member

    Hey I haven't used github before, so I've registered and all now... Here is the link https://github.com/Graylien/HybridAuth/

    there's still a bit to do, but it's working...even if my code isn't the best
     
  7. Graeme

    Graeme Member

    The 2 main things I'm missing is setting the user permissions upon registration, and making the usernames unique.
    How can I go about these?

    With regard to the usernames, if two people who have the same name on their social profile, their username is gonna be the same, are there any quick ways to fix this?

    Apart from these two problems, I think it is functionable...

    You may also want to look at hybridauth_authentication.php in hybridauth/libs, because I haven't used hotaru's database functions to insert data. I just create a new mysql connection and used php PDO. Not sure if this is a problem, but they are simple queries and can be changed anyway
     
  8. Graeme

    Graeme Member

    Which reminds me, I left my database login details in there! haha! here's the new link: https://github.com/Graylien/HotaruHybridAuth

    so I guess that connection must be altered so that the plugin uses hotaru's standard database access...or users are gonna have to enter their database login details again on that file :rolleyes:
     
  9. shibuya246

    shibuya246 Hotaru Developer Staff Member Admin

    Graeme likes this.
  10. nothingman

    nothingman Active Member

    At first, I didn't know what this plugin was about :eek: But after checking it, it I agree that it would be a great addition.
     
  11. Graeme

    Graeme Member

    Thanks, I've merged it, I have a lot of work this week, so will hopefully finish it on the weekend
     
    shibuya246 likes this.
  12. Graeme

    Graeme Member

    just an update for this - i've got a few free days coming up at the end of this week, so I should get this moving again...I'll have something usable ready anyway
     
    shibuya246 likes this.
  13. Graeme

    Graeme Member

    I've got what I think is a working version of this. I've tested it on my site, and it is runs fine!

    There's probably still a few bugs, but nothing I think would be major. Here's the link:

    https://github.com/Graylien/HotaruHybridAuth.git
     
    nothingman and shibuya246 like this.
  14. nothingman

    nothingman Active Member

    I'm getting this error on the installation page. I don't see any config.php file under the hybridauth folder. Though I do see a config.php.tpl file in the \hybridauth\hybridauth\Hybrid\resources folder. Does this file need to be writable? i.e make the config.php.tpl file under the resources folder writable?

     
  15. Graeme

    Graeme Member

    Hi, I thought the config file was auto generated by hybridauth...looks like it isn't...I will upload the config tonight...if u need it right now, you can just Google hybridauth , and download it from their site...i believe it should go in /hybridauth/hybridauth/ where the index file is.

    You could probably just put a blank config.php in that directory actually
     
  16. nothingman

    nothingman Active Member

    I have the files that you have uploaded in github, let me try this method. Thanks for replying.
     
  17. nothingman

    nothingman Active Member

    Hi Graeme, putting a blank config.php did the trick. The installation is done and I got the following message. So, how do I access/use it on my HotaruCMS website?

     
  18. Graeme

    Graeme Member

    just install it from your admin page, and when you go onto your login or registration page on your hotaru site, there should be a new link on there saying to log in with a social account..

    Have a look in the readme files, there are further instructions there too..

    Let me know how it goes, thanks for being the first one to try this !
     
  19. nothingman

    nothingman Active Member

    I installed it from the admin page and got an Internal Server Error. Clicked the back button and it was installed. However, after trying to change the setting (by clicking the HybridAutih link) I'm getting the following errors above every option:

     
  20. Graeme

    Graeme Member

    Yes I haven't done an admin page for hybridauth yet. Ignore the admin settings page for it. Do these errors come out the actual website that your users will see??
     

Share This Page