public function refresh()
    {
        $refreshToken = $this->refreshTokenRepo->get();
        $tokenURL = $this->getLoginURL();
        $tokenURL .= '/services/oauth2/token';

        $response = $this->httpClient->request('post', $tokenURL, [
            'form_params'    => [
                'refresh_token' => $refreshToken,
                'grant_type'    => 'refresh_token',
                'client_id'     => $this->credentials['consumerKey'],
                'client_secret' => $this->credentials['consumerSecret'],
            ],
        ]);

        // Response returns an json of access_token, instance_url, id, issued_at, and signature.
        $token = json_decode($response->getBody(), true);

        // Encrypt token and store token and in storage.
        $this->tokenRepo->put($token);
    }
public function refresh()
    {
        $refreshToken = $this->refreshTokenRepo->get();
        $tokenURL = $this->getLoginURL();
        $tokenURL .= '/services/oauth2/token';

        $response = $this->httpClient->request('post', $tokenURL, [
            'form_params'    => [
                'refresh_token' => $refreshToken,
                'grant_type'    => 'refresh_token',
                'client_id'     => $this->credentials['consumerKey'],
                'client_secret' => $this->credentials['consumerSecret'],
            ],
        ]);

        // Response returns an json of access_token, instance_url, id, issued_at, and signature.
        $token = json_decode($response->getBody(), true);

        // Encrypt token and store token and in storage.
        $this->tokenRepo->put($token);
    }
public function refresh ( ) { $ refreshToken = $ this -> refreshTokenRepo -> get ( ) ; $ tokenURL = $ this -> getLoginURL ( ) ; $ tokenURL .= '/services/oauth2/token' ; $ response = $ this -> httpClient -> request ( 'post' , $ tokenURL , [ 'form_params' => [ 'refresh_token' => $ refreshToken , 'grant_type' => 'refresh_token' , 'client_id' => $ this -> credentials [ 'consumerKey' ] , 'client_secret' => $ this -> credentials [ 'consumerSecret' ] , ] , ] ) ; // Response returns an json of access_token, instance_url, id, issued_at, and signature. $ token = json_decode ( $ response -> getBody ( ) , true ) ; // Encrypt token and store token and in storage. $ this -> tokenRepo -> put ( $ token ) ; }
Refresh authentication token.

@return mixed $response
Refresh authentication token .