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

whoami.mddocs/

WhoAmI

The WhoAmI resource provides information about the currently authenticated admin user, including their permissions, roles, and access levels within the Keycloak admin console.

Capabilities

Current User Information

Retrieve information about the currently authenticated admin user.

/**
 * Get information about the currently authenticated admin user
 * @param params - Parameters containing the current realm context  
 * @returns WhoAmI representation with user information and permissions
 */
find(params: { currentRealm: string }): Promise<WhoAmIRepresentation>;

Usage Examples

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

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

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

// Get current user information
const whoAmI = await kcAdminClient.whoAmI.find({
  currentRealm: 'myrealm'
});

console.log('Current user:', whoAmI.userId);
console.log('Display name:', whoAmI.displayName);
console.log('Realm access:', whoAmI.realmAccess);
console.log('Resource access:', whoAmI.resourceAccess);

Types

interface WhoAmIRepresentation {
  userId?: string;
  realm?: string;
  displayName?: string;
  locale?: string;
  createRealm?: boolean;
  realmAccess?: Record<string, boolean>;
  resourceAccess?: Record<string, Record<string, boolean>>;
}

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