Tumblr should be nearly the same as Twitter from what I understand so I copied the Twitter auth client and made a Tumblr one (see below). The problem is, I get to the Tumblr login/authorize screen and hit ‘allow’ and it gives me an error of “Request failed with code: 401, message: oauth_signature does not match expected value”.
When I var_dump the $oauth_signature i get what looks like a valid signature but I really don’t know for sure. I don’t have a great understanding of oauth yet.
Any tips?
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 = 'http://www.tumblr.com/oauth/authorize';
/**
* @inheritdoc
*/
public $requestTokenUrl = 'http://www.tumblr.com/oauth/request_token';
/**
* @inheritdoc
*/
public $requestTokenMethod = 'POST';
/**
* @inheritdoc
*/
public $accessTokenUrl = 'http://www.tumblr.com/oauth/access_token';
/**
* @inheritdoc
*/
public $accessTokenMethod = 'POST';
/**
* @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';
}
}