https://github.com/apacheex/codeigniter-hybridauth
HybridAuth library (v2, v3) for CodeIgniter 3.x
https://github.com/apacheex/codeigniter-hybridauth
codeigniter codeigniter-library hybridauth php
Last synced: 3 months ago
JSON representation
HybridAuth library (v2, v3) for CodeIgniter 3.x
- Host: GitHub
- URL: https://github.com/apacheex/codeigniter-hybridauth
- Owner: ApacheEx
- License: mit
- Created: 2017-06-25T10:15:59.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-06-15T05:35:23.000Z (about 5 years ago)
- Last Synced: 2025-03-18T21:54:39.255Z (3 months ago)
- Topics: codeigniter, codeigniter-library, hybridauth, php
- Language: PHP
- Homepage:
- Size: 22.5 KB
- Stars: 29
- Watchers: 7
- Forks: 16
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# CodeIgniter-HybridAuth
HybridAuth library for CodeIgniter 3.x## Dependencies
- [HybridAuth 2.x](https://github.com/hybridauth/hybridauth) for `CodeIgniter-HybridAuth v1`
- [HybridAuth 3.x](https://github.com/hybridauth/hybridauth) for `CodeIgniter-HybridAuth v2`
- [CodeIgniter 3.x](https://www.codeigniter.com)## Installation
If you're familiar with [composer](https://getcomposer.org) (recommended :+1:):
- go to `application` and run the following command:
```
composer require hybridauth/hybridauth
```
- then, go to `application/config.php` and set `composer_autoload` to `TRUE`:
```php
$config['composer_autoload'] = TRUE;
```
Alternatively, you can:
- download [HybridAuth library](https://github.com/hybridauth/hybridauth/releases)
- unpack the library into `application/third_party/hybridauth` folderOk, now copy files from this repository into your project:
```
application/config/hybridauth.php
application/libraries/Hybridauth.php
application/controllers/Hauth.php
application/views/hauth
```Good, now let's put `http:///index.php/hauth/window/` as valid `Callback URL` in your provider application.
_e.g for Facebook provider:_
- go to `https://developers.facebook.com/apps/YOUR_APP/fb-login`
- put `http:///index.php/hauth/window/facebook` as `Valid OAuth redirect URIs`Finally, configure the providers inside the `application/config/hybridauth.php` file
- To make correct configuration for providers please visit the [HybridAuth documentation](https://hybridauth.github.io):tada: :tada: :tada:
## Quick Start
- Visit `http:///index.php/hauth` to see enabled providers.
- Modify `Hauth` controller to your fits.## How to use
First, you should load HA library into the system
```php
$this->load->library('hybridauth');
```
To create a login link you can use
```php
anchor('hauth/window/facebook', 'Facebook');
```
Or just put this link to your html code.
```html
Log in with Facebook
```
To access HA instance use `$this->hybridauth->HA`
```php
// Login into facebook.
$adapter = $this->hybridauth->HA->authenticate('Facebook');
// Get user profile.
$profile = $adapter->getUserProfile();
```It's recommended to use Hauth controller (_/index.php/hauth_).