public function createClient($name, $redirect, array $scopes, $key, $secret)
    {
        $client = $this->app->make(Client::class);
        $client->setName($name);
        $client->setRedirectUri($redirect);
        // @TODO support scopes
        //$client->setScopes($scopes);
        $client->setClientKey($key);
        $client->setClientSecret($secret);

        // Apply a new UUID to the client
        $id = $this->generator->generate($this->entityManager, $client);
        $client->setIdentifier($id);

        return $client;
    }