A
A
Archakov Dennis2016-06-06 22:58:00
Laravel
Archakov Dennis, 2016-06-06 22:58:00

Why doesn't Laravel Socialite call getAccessToken()?

I decided to use Socialite and installed a provider for VK. After allowing access from Vkontakte, I am redirected to a callback link and displays this.
ee9eb32c58574511a23923b9ec9c81c5.png
How to fix. Who faced?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Archakov Dennis, 2016-06-06
@archakov06

Corrected. The provider /vendor/laravel/socialite/src/Two/AbstractProvider.php was missing a function:

public function getAccessToken($code)
    {
        $postKey = (version_compare(ClientInterface::VERSION, '6') === 1) ? 'form_params' : 'body';

        $response = $this->getHttpClient()->post($this->getTokenUrl(), [
            'headers' => ['Accept' => 'application/json'],
            $postKey => $this->getTokenFields($code),
        ]);

        $this->credentialsResponseBody = json_decode($response->getBody(), true);

        return $this->parseAccessToken($response->getBody());
    }

Everything worked!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question