yii-eoauth

Yii Framework Extension. EOAuthUserIdentity class implements IUserIdentity Yii interface and the OAuth protocol to authenticate a user. Based on Google's software.

  • 所有者: jorgebg/yii-eoauth
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

Introduction

EOAuthUserIdentity class implements IUserIdentity Yii interface and the OAuth protocol to authenticate a user.

Based on Google's software.

Flattr this git repo

###Resources

##Documentation

###Requirements

  • Yii 1.0 or above

###Installation

  • Extract the release file under protected/extensions/eoauth

###Usage

Use this sample actions for login/logout with Google:


    public function actionLogin() {

        Yii::import('ext.eoauth.*');

        $ui = new EOAuthUserIdentity(
                array(
                	//Set the "scope" to the service you want to use
                        'scope'=>'https://sandbox.google.com/apis/ads/publisher/',
                        'provider'=>array(
                                'request'=>'https://www.google.com/accounts/OAuthGetRequestToken',
                                'authorize'=>'https://www.google.com/accounts/OAuthAuthorizeToken',
                                'access'=>'https://www.google.com/accounts/OAuthGetAccessToken',
                        )
                )
        );

        if ($ui->authenticate()) {
            $user=Yii::app()->user;
            $user->login($ui);
            $this->redirect($user->returnUrl);
        }
        else throw new CHttpException(401, $ui->error);

    }



    public function actionLogout() {

        Yii::app()->user->logout();

        // Redirect to application home page.
        $this->redirect(Yii::app()->homeUrl);
    }

Set to load the extensions in the main.php (by DavidHHuan, thanx!)

'import'=>array(
    'application.models.*',
    'application.components.*',
        'ext.eoauth.*',
        'ext.eoauth.lib.*',
),

License

Some time ago I developed this extension for InDaHouseRulez SL. I no longer work there, but I still support the extension.

The extension was released under the MIT license, so I made a fork on GitHub, where you'll find the latest version:

https://github.com/jorgebg/yii-eoauth

主要指標

概覽
名稱與所有者jorgebg/yii-eoauth
主編程語言PHP
編程語言PHP (語言數: 1)
平台
許可證MIT License
所有者活动
創建於2011-04-28 00:00:10
推送於2015-09-08 08:57:51
最后一次提交2015-03-19 20:01:52
發布數0
用户参与
星數47
關注者數3
派生數14
提交數14
已啟用問題?
問題數4
打開的問題數1
拉請求數2
打開的拉請求數0
關閉的拉請求數1
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?