Sunday, 15 March 2015

php - Yii2 Auth Client Extension for Tumblr -



php - Yii2 Auth Client Extension for Tumblr -

i'm trying utilize auth client extension in yii2 (http://www.yiiframework.com/doc-2.0/ext-authclient-index.html). i've copied twitter auth client class came yiiframework , made own tumblr version. twitter works fine, when utilize tumblr version, error on screen after "is alright application access of info , create posts account? logged in *********." (tumblr oauth page)

there error is: request failed code: 401, message: oauth_signature not match expected value

here tumblr auth client code:

namespace yii\authclient\clients;

use yii\authclient\oauth1;

/** * * illustration application configuration: * * ~~~ * 'components' => [ * 'authclientcollection' => [ * 'class' => 'yii\authclient\collection', * 'clients' => [ * 'tumblr' => [ * 'class' => 'yii\authclient\clients\tumblr', * 'consumerkey' => 'tumblr_consumer_key', * 'consumersecret' => 'tumblr_consumer_secret', * ], * ], * ] * ... * ] * ~~~ * */ class tumblr extends oauth1 { /** * @inheritdoc */ public $authurl = 'https://www.tumblr.com/oauth/authorize'; /** * @inheritdoc */ public $requesttokenurl = 'https://www.tumblr.com/oauth/request_token'; /** * @inheritdoc */ public $requesttokenmethod = 'post'; /** * @inheritdoc */ public $accesstokenurl = 'https://www.tumblr.com/oauth/access_token'; /** * @inheritdoc */ public $accesstokenmethod = 'get'; /** * @inheritdoc */ public $apibaseurl = 'http://api.tumblr.com/v2';

/** * @inheritdoc */ protected function inituserattributes() { homecoming $this->api('/user/info', 'get'); } /** * @inheritdoc */ protected function defaultname() { homecoming 'tumblr'; } /** * @inheritdoc */ protected function defaulttitle() { homecoming 'tumblr'; }

}

you might want seek out hybridauth's version. have used google , facebook version in yii2 , works fine.

php oauth yii2 tumblr

No comments:

Post a Comment