Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Regression: cannot authenticate in keycloak-admin-client #46178

@aqeelat

Description

@aqeelat

Before reporting an issue

  • I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.

Area

adapter/javascript

Describe the bug

Cannot generate auth token using keycloak admin client after upgrading the js library to 26.5.3. Downgrading to v26.5.2 fixes the issue.

Version

26.5.3

Regression

  • The issue is a regression

Expected behavior

No errors to be thrown.

Actual behavior

TypeError: Cannot read properties of undefined (reading 'split')
    at decodeToken (.../lib/utils/decode.js:2:31)
    at KeycloakAdminClient.setRefreshToken (.../lib/client.js:109:37)
    at KeycloakAdminClient.auth (.../lib/client.js:83:14)

How to Reproduce?

  1. install v26.5.3
  2. run the following snippet
import KcAdminClient from '@keycloak/keycloak-admin-client';

const kcAdminClient = new KcAdminClient({
  baseUrl: process.env.KEYCLOAK_URL,
});

await kcAdminClient.auth({
  clientId: process.env.KEYCLOAK_ADMIN_CLIENT_ID,
  clientSecret: process.env.KEYCLOAK_ADMIN_CLIENT_SECRET,
  grantType: 'client_credentials',
});

Anything else?

No response

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions