Overtrue\Socialite\Providers\AbstractProvider::getAccessToken PHP Method

getAccessToken() public method

Get the access token for the given code.
public getAccessToken ( string $code ) : AccessToken
$code string
return Overtrue\Socialite\AccessToken
    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)]);
        return $this->parseAccessToken($response->getBody());
    }