thephpleague / oauth1-client

OAuth 1 Client
MIT License
968 stars 73 forks source link

Tumblr does not accept oauth_signature when trying to get access token #64

Closed JaffParker closed 8 years ago

JaffParker commented 8 years ago

Signature of the request passes fine when I'm getting the OAuth token, but it fails when I try to get the access token. The error that I get from Tumblr is this:

oauth_signature does not match expected value

I tried to Google the error, but the only reasons I found were typos. I verified that I didn't make a mistake, but the error is still there. I appreciate your help!

bencorlett commented 8 years ago

Heya, are you able to clarify what you're doing with a code sample?

JaffParker commented 8 years ago

Sure. To clarify: I'm using Laravel Socialite, which uses League's OAuth1 Client, so here's the code:

    public function user()
    {
        if (! $this->hasNecessaryVerifier()) {
            throw new InvalidArgumentException('Invalid request. Missing OAuth verifier.');
        }

        $user = $this->server->getUserDetails($token = $this->getToken());
        dd($user);
    }

Then getToken() looks like this:

    protected function getToken()
    {
        $temp = $this->request->getSession()->get('oauth.temp');

        return $this->server->getTokenCredentials(
            $temp, $this->request->get('oauth_token'), $this->request->get('oauth_verifier')
        );
    }

And $this->server is an instance of League\OAuth1\Client\Server\Tumblr class.

bencorlett commented 8 years ago

Are the values of:

$temp,
$this->request->get('oauth_token'),
$this->request->get('oauth_verifier')

All correct?

Obviously it's not easy to know if they're "correct", but do they look suspicious or are any empty?

JaffParker commented 8 years ago

You sir, are a genius. oauth.temp did not have the secret, it was removed at some step. Pretty stupid error, but thank you for guiding me :)

bencorlett commented 8 years ago

You’re most welcome :)

On 23 Mar 2016, at 9:54 AM, Jaff Parker notifications@github.com wrote:

Closed #64 https://github.com/thephpleague/oauth1-client/issues/64.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/thephpleague/oauth1-client/issues/64#event-599504989