chore(keycloak): code cleanup

This commit is contained in:
Masaki Yatsu
2025-10-29 15:33:20 +09:00
parent fd0c359407
commit 82f90f621b
35 changed files with 613 additions and 599 deletions

View File

@@ -23,26 +23,22 @@ async function main() {
invariant(clientId, "KEYCLOAK_CLIENT_ID is required");
try {
// Find the client
const clients = await kcAdminClient.clients.find({ realm, clientId });
if (clients.length === 0) {
throw new Error(`Client '${clientId}' not found in realm '${realm}'`);
}
const client = clients[0];
// Get client secret
const clientSecret = await kcAdminClient.clients.getClientSecret({
realm,
id: client.id!,
});
console.log(`Client '${clientId}' secret: ${clientSecret.value}`);
} catch (error) {
console.error(`Error retrieving client secret: ${error}`);
process.exit(1);
}
}
main().catch(console.error);
main().catch(console.error);