src/AuthorizesWithOAuth2.php
protected function refreshAccessToken($token)
    {
        switch ($this->grant) {
            case 'provided_token':
                throw new UnauthorizedException('[internal]', 'The provided token expired.');

            case 'client_credentials':
                return $this->getTokenByClientCredentialsGrant();

            case 'authorization_code':
                return $this->getTokenByRefreshTokenGrant($token);

            default:
                throw new \Exception('Unsupported grant type. Check $this->grant.');
        }
    }
protected function refreshAccessToken($token)
    {
        switch ($this->grant) {
            case 'provided_token':
                throw new UnauthorizedException('[internal]', 'The provided token expired.');

            case 'client_credentials':
                return $this->getTokenByClientCredentialsGrant();

            case 'authorization_code':
                return $this->getTokenByRefreshTokenGrant($token);

            default:
                throw new \Exception('Unsupported grant type. Check $this->grant.');
        }
    }
protected function refreshAccessToken ( $ token ) { switch ( $ this -> grant ) { case 'provided_token' : throw new UnauthorizedException ( '[internal]' , 'The provided token expired.' ) ; case 'client_credentials' : return $ this -> getTokenByClientCredentialsGrant ( ) ; case 'authorization_code' : return $ this -> getTokenByRefreshTokenGrant ( $ token ) ; default : throw new \ Exception ( 'Unsupported grant type. Check $this->grant.' ) ; } }
Get a new access token based on the chosen grant.

@param $token
@return mixed
@throws \Exception
Get a new access token based on the chosen grant .