I'm trying to use the Auth Client Extension in Yii2 (http://www.yiiframework.com/doc-2.0/ext-authclient-index.html). I've copied the Twitter Auth Client class that came with YiiFramework and made my own Tumblr version. Twitter works fine, but when I use my Tumblr version, I get an error on the screen after the "Is it alright for this application to access some of your data and make posts to your account? You are logged in as *********." (Tumblr oauth page)
There error is: Request failed with code: 401, message: oauth_signature does not match expected value
Here is my Tumblr auth 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';
/**
* @inheritdoc
*/
protected function initUserAttributes()
{
return $this->api('/user/info', 'GET');
}
/**
* @inheritdoc
*/
protected function defaultName()
{
return 'tumblr';
}
/**
* @inheritdoc
*/
protected function defaultTitle()
{
return 'Tumblr';
}
}
You might want to try out Hybridauth's version. I have used the Google and Facebook version in Yii2 and it works fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With