Skip to content

sobit/hybridauth-component

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Nov 17, 2013
8178166 · Nov 17, 2013

History

3 Commits
Nov 17, 2013
Nov 17, 2013
Nov 17, 2013
Nov 17, 2013
Nov 17, 2013

Repository files navigation

hybridauth-component

Component for Yii Framework based application which provides simple configuration interface for HybridAuth library.

Installation

Add dependency to your composer.json file:

{
    "require": {
        "sobit/hybridauth-component": "dev-master"
    }
}

Update your protected/config/main.php file:

<?php

Yii::setPathOfAlias('vendor', dirname(__FILE__) . '/../../vendor');

return array(
    'components' => array(
        'auth' => array(
            'class'     => 'vendor.sobit.hybridauth-component.HybridAuthComponent',
            'action'    => 'controller/action',
            'debugMode' => false,
            'providers' => array(
                'Google' => array(
                    'enabled' => true,
                    'keys'    => array('id' => '', 'secret' => ''),
                ),
                'Facebook' => array(
                    'enabled' => true,
                    'keys'    => array('id' => '', 'secret' => ''),
                    'scope'   => 'email, user_about_me, user_birthday, user_hometown',
                ),
                'Twitter' => array(
                    'enabled' => true,
                    'keys'    => array('id' => '', 'secret' => ''),
                ),
            ),
        ),
    ),
);

Usage

Example:

$twitter = Yii::app()->auth->authenticate('Twitter');
$userProfile = $twitter->getUserProfile();
echo sprintf('Hi there, %s!', $userProfile->displayName);
$twitter->setUserStatus('Hello, World!');
$userContacts = $twitter->getUserContacts();

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages