public function parseProfileResponse(Response $response, AccessTokenInterface $access_token)
    {
        $profile = $response->json();

        if (gettype($profile) !== 'object') {
            throw new InvalidProfileException();
        }

        if (isset($profile->error)) {
            $error = $profile->error;

            throw new InvalidProfileException($error->type.': '.$error->message, $error->code);
        }

        $profile->access_token = $access_token->token();

        return $this->profile->instantiate($profile, $this->name);
    }