public function registerClient(string $name, array $redirectUris): array
    {
        do {
            $client = Client::createNewClient($name, $redirectUris);
        } while ($this->clientRepository->idExists($client->getId()));

        $secret = $client->generateSecret();
        $client = $this->clientRepository->save($client);

        return [$client, $secret];
    }