I am trying to use the Auth client extension in Yii2 ( http://www.yiiframework.com/doc-2.0/ext-authclient-index.html ). I copied the Auth Client Twitter class that came with YiiFramework and made my own version of Tumblr. Twitter is working fine, but when I use my version of Tumblr, I get an error message on the screen after "Is it okay for this application to access some of your data and make messages in your account?" You are logged in as **** ***** ". (Tumblr oauth Page)
Error: Error with code: 401, message: oauth_signature does not match the expected value
Here is my Tumblr client code:
namespace yii\authclient\clients;
use yii\authclient\OAuth1;
/** * * Example 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 ';
protected function initUserAttributes() { return $this->api('/user/info', 'GET'); } protected function defaultName() { return 'tumblr'; } protected function defaultTitle() { return 'Tumblr'; }
}
code>
source share