2017 © Pedro Peláez
 

yii2-extension yii2-oauth2client

Rho Social OAuth 2 Client for Yii 2 Web Applications.

image

rhosocial/yii2-oauth2client

Rho Social OAuth 2 Client for Yii 2 Web Applications.

  • Sunday, September 20, 2015
  • by vistart
  • Repository
  • 8 Watchers
  • 1 Stars
  • 39 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 1 Versions
  • 11 % Grown

The README.md

Rho Social OAuth 2 Client for Yii 2 Web Applications.

Rho Social OAuth 2 Client for Yii 2 Web Applications. This extension is currently under development. Please do not download, fork or use this extension if you didn't obtained the test invitation, and we temprarily do not accept the pull requests., (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist rhosocial/yii2-oauth2client "*"

or add, (*4)

"rhosocial/yii2-oauth2client": "*"

to the require section of your composer.json file., (*5)

Usage

Attach the Auth Action to Controller:, (*6)

class SiteController extends Controller
{
    public function actions()
    {
        return [
            'auth' => [
                'class' => 'rhosocial\Oauth2Client\AuthAction',
                'successCallback' => [$this, 'onAuthSuccess'],
            ],
        ]
    }
    public function onAuthSuccess($client)
    {
        $attributes = $client->getUserAttributes();
        // user login or signup comes here
    }
}

Attach the following code to the Component section of main configuration:, (*7)

'authClientCollection' => [
    'class' => 'yii\authclient\Collection',
    'clients' => [
        'rho_social' => [
            'class' => 'rhosocial\Oauth2client\Oauth2client',
            'clientId' => <client id>,
            'clientSecret' => <client secret>,
        ],
    ],
],

Please replace the <client id> and <client secret> with what assigned for you., (*8)

Then use the AuthChoice Widget in your login view, insert the following code into where you want:, (*9)

<?= yii\authclient\widgets\AuthChoice::widget([
    'baseAuthUrl' => ['site/auth'],
    'popupMode' => true,
]);?>

If you didn't choose the 'site/auth' as your Auth Action, please modify the 'baseAuthUrl' property to the actual route., (*10)

Contact Us

Join the chat at https://gitter.im/rhosocial/yii2-oauth2client, (*11)

If you have any problems or good ideas about yii2-oauth2client, please discuss there, or send an email to opensource@dev.rho.social. Thank you!, (*12)

If you want to send an email with your issues, please briefly introduce yourself first, for instance including your title and github homepage., (*13)

The Versions

20/09 2015

dev-master

9999999-dev

Rho Social OAuth 2 Client for Yii 2 Web Applications.

  Sources   Download

BSD-3-Clause

The Requires

 

by rhosocial

social extension yii2 client oauth2 rho