PHP Classes
elePHPant
Icontem

MyLogin: Authenticate users using Facebook, Twitter, Google

Recommend this page to a friend!
  Info   View files Documentation   View files View files (5)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2017-03-30 (23 days ago) RSS 2.0 feedNot enough user ratingsTotal: 332 This week: 3All time: 6,816 This week: 302Up
Version License PHP version Categories
mylogin 1.0.4Custom (specified...5PHP 5, User Management, Social Networ...
Description Author

This package can authenticate users using Facebook, Twitter or Google.

It can perform OAuth authentication of a user redirecting to either Facebook, Twitter or Google authorization pages.

If the user is successfully authenticated with any of these OAuth providers, session variables will be set with the user profile details.

Name: Yorch Ponce <contact>
Classes: 6 packages by
Country: Mexico Mexico
Age: 35
All time rank: 286832 in Mexico Mexico
Week rank: 164 Up3 in Mexico Mexico Up
Innovation award
Innovation award
Nominee: 1x

Details

MyLogin

Description

Abstract Class for Login in Social Networks

Requirements

Developer Documentation

Execute phpdoc -d MyLogin/

Installation

Create file composer.json

{
    "require": {
    	"php": ">=5.4.0",
        "yorch/mylogin" : "dev-master",
        "monolog/monolog": "1.13.1",
        "facebook/php-sdk-v4" : "4.0.23",
        "ruudk/twitter-oauth" : "dev-master",
        "google/apiclient": "1.*"
    }
}

Execute composer.phar install

Example


$social = MyLogin::getInstance(MyLogin::FACEBOOK, 'APP_ID', 'APP_SECRET', 'CALLBACK_URL');

if ($social->login()){
	redirect_to(MYPAGE);
}
else
	redirect_to($social->getAuthUrl());

Notes

The Library creates session variables:


$_SESSION['SOCIAL_TYPE'] = ('FB', 'TW', 'GP')
$_SESSION['SOCIAL_ID'] = 'SOCIAL_ID'
$_SESSION['SOCIAL_NAME'] = 'SOCIAL_NAME'
$_SESSION['SOCIAL_LNAME'] = 'SOCIAL_LAST_NAME'
$_SESSION['SOCIAL_LINK'] = 'http://SOCIAL_URL/'
$_SESSION['SOCIAL_IMG'] = 'http://SOCIAL_IMG/'
$_SESSION['SOCIAL_MAIL'] = 'SOCIAL@MAIL'
$_SESSION['SOCIAL_SESSION'] = 'SOCIAL_TOKEN';

This tool uses PHP Sessions and Facebook SDk, Abraham Twitter OAuth Library and Google Api Client.

References

https://developers.facebook.com/ https://dev.twitter.com/ https://console.developers.google.com https://en.wikipedia.org/wiki/OAuth

P.D. Let's go play !!!

  Files folder image Files  
File Role Description
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License
Plain text file MyLogin.class.php Class Class source
Plain text file MySocial.class.php Class Class source
Accessible without login Plain text file README.md Doc. Documentation

 Version Control Unique User Downloads Download Rankings  
 100%
Total:332
This week:3
All time:6,816
This week:302Up