2017 © Pedro Peláez
 

library hybridauth-component

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

image

sobit/hybridauth-component

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

  • Sunday, November 17, 2013
  • by sobit
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

hybridauth-component

Component for Yii Framework based application which provides simple configuration interface for [HybridAuth library][2]., (*1)

Installation

Add dependency to your composer.json file:, (*2)

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

Update your protected/config/main.php file:, (*3)

<?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:, (*4)

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

The Versions

17/11 2013

dev-master

9999999-dev https://github.com/sobit/hybridauth-component

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

  Sources   Download

MIT

The Requires

 

by Sobit Akhmedov

component yii hybridauth sobit