Social Auth Plugin is the authentication and authorization solution based on social networks for web applications.
Nowaday, almost internet users have at least one account on social networks (like Facebook, Twitter or Google Plus …). Therefore allowing users log in your applications/sites (apps) via social network accounts is not only help your users approach your apps easily but also help you reduce amount of work which is not necessary to focus on developing your apps. So now I introduce you a simple way to make a Social Auth plugin for your apps.
This product is free for both personal and commercial uses. If you like to share or distribute this product please include the link of this article at the place or web page where you are sharing or distributing this one, please DO NOT share our direct download links. If you want to share our articles on your site, you are free to copy excerpts but please DO NOT copy entire articles.
Please note, resources (like: images, videos, audios ...) are used for demonstration purpose only. Some resources may have third party licenses so please respect them in that case.
SONHLAB Social Auth (SSA) Features:
- Registration and login base on social network sites.
- Get user data from social site (base on the social site’s support).
- Easy to deploy on several apps.
- Easy to store user data in your database (MySQL …).
- Social Network List: Facebook, Twitter, Google.
11 May 2018: Version 4.0:
- Update Facebook SDK 5.6.x
31 Mar 2017: Version 3.0:
- Update Facebook SDK 5.
02 Oct 2014: Version 2.0
- Update Facebook SDK 4.
- Update Goolge API.
- Update Twitter API.
- Change File Structure for more friendly.
26 Jul 2012:
- Add index.php file to test easier.
31 May 2012:
- First Version.
Installing SONHLAB Social Auth:
1. Download Free SONHLAB Social Auth (SSA) Plugin.
2. Unzip the downloaded file. After unzip you will have auth folder.
3. Upload auth folder to your server.
4. Modify appconf.php file in the auth folder:
Facebook: insert appid and secret info into the file (if you do not have yet you can get them from Facebook).
Twitter: Insert consumer_key and consumer_secret (if you do not have yet you can get them from Twitter). Then you also need to set Callback URL on Twitter App page (https://apps.twitter.com/). From your Twitter App page, choose your app and move to “Settings” tab, then set “Callback URL” point to “twitter.php” file in “/auth/platforms/twitter-app/” folder.
Example: In my demo, I set Callback URL:
Google: Insert Client ID and Client Secret (if you do not have yet you can get them from Google). Set “Redirect URIs” on Google page (the page you get Client ID and Client Secret). The “Redirect URIS” have to point to “google.php” file in “/auth/platforms/google-app/” folder.
In our demo, the home page is:
So the “Redirect URIS” I set for our demo is:
After you completed modifying appconf.php you can start to use the plugin.
When Authentication and Authorization are successful, user data will be store in $_SESSION[“userprofile”] (it’s an array). Then, you can use the data in any way you want (show it on the screen, store in your database, etc.).
This is just a basic tutorial to you can use this plugin quickly. For advance configurations please go to the social site and read their API Documentation.
That’s it. I hope you enjoyed this plugin and find it useful!
If you have questions or suggestions you can go to Social Auth PHP plugin Support Zone to discuss more.