public function renewTokens()
    {
        if (! $this->accessToken) {
            throw new CoreException('Can\'t renew the access token if there isn\'t one valid');
        }

        if (! $this->refreshToken) {
            throw new CoreException('Can\'t renew the access token if there isn\'t a refresh token available');
        }

        $response = $this->authentication->refresh_token( $this->refreshToken );

        if (empty($response['access_token']) || empty($response['id_token'])) {
            throw new ApiException('Token did not refresh correctly. Access or ID token not provided.');
        }

        $this->setAccessToken($response['access_token']);
        $this->setIdToken($response['id_token']);
    }