PHPackages                             thetechnicalcircle/codeigniter\_social\_login - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. thetechnicalcircle/codeigniter\_social\_login

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

thetechnicalcircle/codeigniter\_social\_login
=============================================

Codeigniter Social Login Provides Third Party Logins in your Application using official SDK provided by Social Media Companies

25803PHP

Since Jul 30Pushed 7y ago1 watchersCompare

[ Source](https://github.com/mnkgrover08/codeigniter_social_login)[ Packagist](https://packagist.org/packages/thetechnicalcircle/codeigniter_social_login)[ RSS](/packages/thetechnicalcircle-codeigniter-social-login/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

codeigniter\_social\_login
==========================

[](#codeigniter_social_login)

Codeigniter Social Login provides your application ability to login with third party apps like facebook twitter google and linkedin

Usage :

VIA COMPOSER :

1. Install composer globally on your machine from
2. Go to root directory of your Codeigniter Application.
3. In Terminal issue the following command
4. composer require "thetechnicalcircle/codeigniter\_social\_login:dev-master"

This will create a vendor folder in your root directory with codeignitor social login as package

So now the Package has been downloaded to your system

USAGE :

In your Codeigniter Controller at the Top Include the main File of the library downloaded

require\_once(FCPATH."vendor/thetechnicalcircle/codeigniter\_social\_login/src/Social.php");

```
class User extends CI_Controller {

	function __construct(){
    		parent::__construct();
    		$this->load->library('session');
    		$this->load->helper('url');
  	}

	public function login(){
		$connect = $this->uri->segment(2);
		if($this->session->userdata('logged_user')== true){
      			if($connect) {
				$this->load->view('welcome_message');
			} else {
				redirect(base_url('user/dashboard'));
			}
    		}
    		if($connect == 'fb') {
			$this->login_facebook();
			$this->load->view('welcome_message');
		} elseif($connect == 'twt') {
			$this->login_twitter();
			$this->load->view('welcome_message');
		} elseif($connect == 'gmail') {
			$this->login_gmail();
			$this->load->view('welcome_message');
		} elseif($connect == 'ldn') {
			$this->login_linkedin();
			$this->load->view('welcome_message');
		} elseif($connect == 'fs') {
			$this->login_foursquare();
			$this->load->view('welcome_message');
		} elseif($connect == 'yahoo') {
			$this->login_yahoo();
			$this->load->view('welcome_message');
		}
	}

	private function login_facebook() {
		$site_url = $this->config->item('base_url');
		$fb_App_id = "YOUR FB APP ID";
		$fb_secret = "YOUR FB APP SECRET";
		$fb_scope = "public_profile,email,user_friends";
		$social_instance = new Social();
		$fbData = $social_instance->facebook_connect(NULL,$this->session,$site_url,$fb_App_id,$fb_secret,$fb_scope);
		if(!empty($fbData['redirectURL'])) {
			redirect($fbData['redirectURL']);
		} else {
			if(!empty($fbData['id'])) {
				echo "";
				print_r($fbData);
				echo "";die; /* all the data returned by facebook will be in this variable (Array). Play with it. */
			}
		}
	}

	private function login_twitter() {
  		$site_url = $this->config->item('base_url')."/";
  		$client_id = "YOUR TWITTER CLIENT ID";
  		$client_secret = "YOUR TWITTER CLIENT SECRET";
  		$social_instance = new Social();
  		$twtData = $social_instance->twitter_connect($client_id,$client_secret,$site_url);
  		if(!empty($twtData['redirectURL'])) {
  			redirect($twtData['redirectURL']);
  	  	} else {
  			if(!empty($twtData['id'])) {
  				echo "";print_r($twtData);echo "";die();
  			}
  		}
  	}

  	private function login_linkedin() {
		$site_url = $this->config->item('base_url')."/";
		$client_id = "YOUR LINKED IN CLIENT ID";
		$client_secret = "YOUR LINKED IN SECRET";
		$social_instance = new Social();
		$ldnData = $social_instance->linkedin_connect(NULL,$site_url,$client_id,$client_secret);
		if(!empty($ldnData['redirectURL'])) {
			 redirect($ldnData['redirectURL']);
		} else {
			if(!empty($ldnData['id'])) {
				echo "";print_r($ldnData);echo "";die();
		  	}
		}
	}

  	private function login_gmail() {
		$site_url = $this->config->item('base_url')."/";
		$client_id = "YOUR GMAIL CLIENT ID";
		$client_secret = "YOUR GMAIL CLIENT SECRET";
		$client_api_key = "GMAIL API KEY";
		$social_instance = new Social();
		$gmailData = $social_instance->gmail_connect(NULL,$site_url,$client_id,$client_secret,$client_api_key);
		if(!empty($gmailData['redirectURL'])) {
			redirect($gmailData['redirectURL']);
		} else {
			if(!empty($gmailData['email'])) {
				echo "";print_r($gmailData);echo "";die();
			}
		}
	}

	private function login_yahoo() {
  		$site_url = $this->config->item('base_url')."/";
  		$social_instance = new Social();
  		$yahooData = $social_instance->yahoo_connect($site_url);
  		if(!empty($yahooData['redirectURL'])) {
  			redirect($yahooData['redirectURL']);
  		} else {
  			if(!empty($yahooData['email'])) {
  				echo "";print_r($yahooData);echo "";die();
  			}
  		}
  	}

  	private function login_foursquare() {
  		$site_url = $this->config->item('base_url')."/";
  		$client_id = "FOURSQUARE CLIENT ID";
  		$client_secret = "FOURSQUARE CLIENT SECRET";
  		$social_instance = new Social();
  		$fsData = $social_instance->foursquare_connect($client_id,$client_secret,$site_url);
  		if(!empty($fsData['redirectURL'])) {
  			redirect($fsData['redirectURL']);
  		} else {
  			if(!empty($fsData['id'])) {
  				echo "";print_r($fsData);echo "";die();
  			}
  		}
  	}
}

```

So this is your complete controller code to get Data from social Platforms in form of Array. Now you can Play with it and store data in database and authenticate users.

###  Health Score

24

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/82e29dc3d4108e833b057ffe4a3d008e7f2caa797f86c3be8a93dd97dc23d246?d=identicon)[thetechnicalcircle](/maintainers/thetechnicalcircle)

---

Top Contributors

[![mnkgrover08](https://avatars.githubusercontent.com/u/53553130?v=4)](https://github.com/mnkgrover08 "mnkgrover08 (9 commits)")

### Embed Badge

![Health badge](/badges/thetechnicalcircle-codeigniter-social-login/health.svg)

```
[![Health](https://phpackages.com/badges/thetechnicalcircle-codeigniter-social-login/health.svg)](https://phpackages.com/packages/thetechnicalcircle-codeigniter-social-login)
```

###  Alternatives

[firebase/php-jwt

A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.

9.8k435.8M1.8k](/packages/firebase-php-jwt)[league/oauth2-client

OAuth 2.0 Client Library

3.8k115.1M1.0k](/packages/league-oauth2-client)[google/auth

Google Auth Library for PHP

1.4k266.3M125](/packages/google-auth)[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k98.4M87](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99895.6M96](/packages/league-oauth1-client)[lab404/laravel-impersonate

Laravel Impersonate is a plugin that allows to you to authenticate as your users.

2.3k15.7M42](/packages/lab404-laravel-impersonate)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
