Yii 1.1: api-module

A PHP library for OAuth 1.0a consumers and servers.

...built your oauth server by yii。 ...

  • include oauth-php
  • support web(oauth) and app(xauth) 。


  • programer join and manager
  • oauth/authorize 请求用户授权Token
  • oauth/access_token 获取授权过的Request Token
  • oauth/access_token 获取授权过的Access Token


...Yii 1.1.8 or above ...


...1. config the oauth server ...

// application components
            //it must be path model
            //hidden index.php
    // application modules
                'connectionString' => 'mysql:host=localhost;port=3306;dbname=yiisns',
                'username' => 'root',
                'password' => '111111',

...2. install oauth.sql (locate:modules\api\data\oauth.sql)...

...3. create you oauth store accout at “oauth_server_registry” ...

INSERT INTO `oauth_server_registry` (`osr_id`, `osr_usa_id_ref`, `osr_consumer_key`, `osr_consumer_secret`, `osr_enabled`, `osr_status`, `osr_requester_name`, `osr_requester_email`, `osr_callback_uri`, `osr_application_uri`, `osr_application_title`, `osr_application_descr`, `osr_application_notes`, `osr_application_type`, `osr_application_commercial`, `osr_issue_date`, `osr_timestamp`) VALUES
(1, 1, 'admin', '123456', 1, 'active', 'biner', 'huanghuibin@gmail.com', 'b.php', 'a.php', 'oauth测试标题', '这是个非常helloworld的描述', '笔记?', 'system', 0, '2011-09-20 17:35:50', '2011-09-20 17:35:50'),


...external resources for this extension...

Total 4 comments

#12421 report it
stepanic at 2013/03/19 03:41pm
Documentation English

I see that this is implemented fantastic, but I don't know to understand Chinese language :( Can you please upload English version of this extension. Thank you in advance.

#9315 report it
mteichtahl at 2012/08/03 02:49am

I have had a good look through the code and it seems clean enough.

However, I cant seem to make this work.

I make the first call to /api/client/web and receive

Undefined index: oauth_token /Library/WebServer/Documents/adapptrRetail/protected/modules/api/vendors/oauth-php/client/lifeduoauth.php(170)

$this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);

If possible can you please explain the proper sequence for authentication ?

#5924 report it
yiqing95 at 2011/11/25 04:44am
need more usage description

hi : could you kindly give us more description of usage ? I am interested to this module very much . you can create an thread in china forum .(你能多给下如何使用此模块的描述吗 可以在中文区开一个话题的 最好用英文描述 不然会投负票的 :) )

#5922 report it
bigardusklei at 2011/11/25 03:39am
Looks great!

Hi! this extension looks great! Could there be the possibility of an English version of the documentation? Thank you very much in advance!

Leave a comment

Please to leave your comment.

Create extension