regenerate_client_secret
Generate a new client secret for a specified client in the Keycloak IAM system. Provide the client's database ID and optional realm to update credentials securely.
Instructions
Regenerate the client secret.
Args:
id: The client's database ID
realm: Target realm (uses default if not specified)
Returns:
New client secret object
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| realm | No |
Implementation Reference
- src/tools/client_tools.py:252-268 (handler)The handler function for the 'regenerate_client_secret' MCP tool. It is decorated with @mcp.tool(), which handles both registration and schema inference from the function signature and type hints. The function regenerates the client secret by making a POST request to Keycloak's API via the KeycloakClient instance.@mcp.tool() async def regenerate_client_secret( id: str, realm: Optional[str] = None ) -> Dict[str, str]: """ Regenerate the client secret. Args: id: The client's database ID realm: Target realm (uses default if not specified) Returns: New client secret object """ return await client._make_request( "POST", f"/clients/{id}/client-secret", realm=realm )