Uploaded image for project: 'Red Hat build of Keycloak'
  1. Red Hat build of Keycloak
  2. RHBK-4326

Regression: cannot authenticate in keycloak-admin-client [GHI#46178]

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False

      Before reporting an issue

      [x] 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

      [x] 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

              Unassigned Unassigned
              pvlha Pavel Vlha
              Keycloak Core Clients
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: