public function registerRefreshTokenMiddleware(IRefreshTokenMiddleware $middleware): IOAuthClient
    {
        $middleware->setClient($this);
        $this->refreshTokenMiddlewares[get_class($middleware)] = $middleware;

        return $this;
    }