CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-keycloak--keycloak-admin-client

A comprehensive TypeScript client library for interacting with Keycloak's Administration API.

Pending
Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

attack-detection.mddocs/

Attack Detection

Attack detection provides brute force protection management, allowing administrators to monitor and clear attack detection data for users who have been temporarily disabled due to failed login attempts.

Capabilities

Brute Force Attack Management

Manage brute force attack detection data and clear protection locks.

/**
 * Get brute force attack detection data for a specific user
 * @param params - Parameters containing the user ID
 * @returns Attack detection data or undefined if not found
 */
findOne(params: { id: string }): Promise<Record<string, any> | undefined>;

/**
 * Clear brute force attack detection data for a specific user
 * @param params - Parameters containing the user ID
 * @returns void
 */
del(params: { id: string }): Promise<void>;

/**
 * Clear all brute force attack detection data for the realm
 * @returns void
 */
delAll(): Promise<void>;

Usage Examples

import KeycloakAdminClient from "@keycloak/keycloak-admin-client";

const kcAdminClient = new KeycloakAdminClient({
  baseUrl: 'http://localhost:8080',
  realmName: 'myrealm',
});

await kcAdminClient.auth({
  username: 'admin',
  password: 'admin',
  grantType: 'password',
  clientId: 'admin-cli',
});

// Get attack detection data for a user
const attackData = await kcAdminClient.attackDetection.findOne({
  id: 'user-id-here'
});

if (attackData) {
  console.log('User has attack detection data:', attackData);
  
  // Clear attack detection for this specific user
  await kcAdminClient.attackDetection.del({
    id: 'user-id-here'
  });
  
  console.log('Attack detection data cleared for user');
}

// Clear all attack detection data in the realm
await kcAdminClient.attackDetection.delAll();
console.log('All attack detection data cleared');

Common Use Cases

Unlocking Users: When users are temporarily disabled due to brute force protection, administrators can use this API to clear the attack detection data and allow users to attempt login again.

Monitoring Security: Review attack detection data to identify patterns of failed login attempts and potential security threats.

Bulk Cleanup: Clear all attack detection data when needed, such as after resolving a system-wide authentication issue.

docs

attack-detection.md

authentication-management.md

cache-management.md

client-configuration.md

client-management.md

client-policies.md

client-scopes.md

components.md

group-management.md

identity-providers.md

index.md

organization-management.md

realm-management.md

role-management.md

server-info.md

user-management.md

user-storage-provider.md

utility-functions.md

whoami.md

tile.json