Yii 1.1: eoauth

EOAuth implements the OAuth protocol.


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

Based on Google's software.

Note: Please post the issues on Github


Download Last release




  • Yii 1.0 or above


  • Extract the release file under protected/extensions/eoauth


Use this sample actions for login/logout with Google:

public function actionLogin() {
        $ui = new EOAuthUserIdentity(
                    //Set the "scope" to the service you want to use
        if ($ui->authenticate()) {
        else throw new CHttpException(401, $ui->error);
    public function actionLogout() {
        // Redirect to application home page.


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:


Change Log

September 10, 2010

  • Initial release.

Total 12 comments

#18788 report it
Nashi at 2015/01/08 06:05am
using POST instead of GET

@raxy I've modified GetTokenFromUrl function in EOAuthUtils.php. It looks like that:

private static function GetTokenFromUrl($data, $endpoint = null) {
    $ch = curl_init();
    if (!isset($endpoint)) { // use GET
        curl_setopt($ch, CURLOPT_URL, $data);
    } else { // use POST (you need to provide $endpoint variable in function call)
        curl_setopt($ch, CURLOPT_URL, $endpoint);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
#18787 report it
raxy at 2015/01/08 05:32am

can someone please help how to send POST instead of GET?

#18271 report it
varadk at 2014/10/09 09:23am
how to access details after login.

Hi, I installed this application on my application.It is working fine but it returns a token. i want to get user details such as username,email etc .how to get/retrieve this information array?

#15676 report it
Tpona at 2013/12/06 02:37am
twitter oauth not working

Hi in my case twitter authenticate not working. After authorize my application doesn't happen redirect on my authorize url. any solution ? And no errors ((

#10158 report it
karmraj at 2012/10/08 05:23am
How to connect with linkedin profile

I am getting error like :

Error 401


I have make following changes.

    $ui = new EOAuthUserIdentity(
                //Set the "scope" to the service you want to use
#10157 report it
karmraj at 2012/10/08 05:04am
How to connect with linkedin profile

@Burzum : I have install this extension its working perfectly. I can login to my application with my gmail accoount automatically. But i dont know how to connect to my application with my linkedin profile? where i need to make changes??

#9103 report it
Dark-Sun at 2012/07/20 03:23am
how to get information after getAccessToken?

it's nice extension but it really lacks documentation, I even could'nt reach right information about how to use the token even from google-api-dfp-php (the api which this extension is based on). I'm not sure if this part is included in this api or not!!

#5959 report it
Nashi at 2011/11/30 06:03am

How to make it work with POST requests instead of GETs?

#4365 report it
Burzum at 2011/06/29 05:00am

That's work fine for the authentification, but what about calling services after? Like http://api.linkedin.com/v1/people/~

Is it possible with your extention?

#4356 report it
Burzum at 2011/06/28 11:26am
Thank you!!!

You saved my life!! I'm using your classes to connect with Linkedin, that works fine!!

#4283 report it
idrozd at 2011/06/21 10:00pm
Would it work with ouath2?


#1930 report it
Davidhhuan at 2010/10/17 07:27am
avoid meeting PHP standard issue

Hi,CGeorge, following your guide to test this extension, there is an issue after i logining and allowing in google to use oauth

EOAuthUserIdentity::authenticate() [<a href='eoauthuseridentity.authenticate'>eoauthuseridentity.authenticate</a>]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition &quot;OAuthToken&quot; of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition

That is a standard PHP deserialization issue.

The way to avoid this issue is that, set to load the extensions in the main.php


Leave a comment

Please to leave your comment.

Create extension
No downloadable files yet
  • Yii Version: 1.1
  • License: MIT License
  • Developed by: CGeorge
  • Category: Auth
  • Votes: +18 / -1
  • Downloaded: 536 times
  • Created on: Sep 10, 2010
  • Last updated: Aug 21, 2014
  • Tags: oauth