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

Skip to content

admin-cli invalid credentials #30866

@taylorfssaraiva

Description

@taylorfssaraiva

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

admin/cli

Describe the bug

When trying to authenticate kcadm.sh with admin password, an invalid credential error is returned.

When running the command bellow, we're getting Invalid user credentials [invalid_grant]
kcadm.sh config credentials --server "$KEYCLOAK_SERVER_URL" --realm "master" --user "$KEYCLOAK_ADMIN" --password "$KEYCLOAK_ADMIN_PASSWORD"

We tried using the KC_CLI_PASSWORD variable introduced in the latest version. It doesn't return any error for credentials, but it asks for client-secret when running any other kcadm command. But admin-cli doesn't have any secret.

export KC_CLI_PASSWORD=$KEYCLOAK_ADMIN_PASSWORD
kcadm.sh config credentials --server "$KEYCLOAK_SERVER_URL" --realm "master" --user "$KEYCLOAK_ADMIN"
kcadm.sh get users
Screenshot 2024-06-27 at 11 56 36

Version

25.0.1

Regression

  • The issue is a regression

Expected behavior

kcadm.sh is authenticated and the following commands doesn't ask for authentication

Actual behavior

Invalid credentials

How to Reproduce?

docker run -p 8080:8080 -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD="admin" -e KC_CLI_PASSWORD="admin" quay.io/keycloak/keycloak:25.0.1 start-dev

ssh into container then:

./kcadm.sh config credentials --server http://localhost:8080 --realm master --user admin

./kcadm.sh get users

Anything else?

passing --password was working fine in version 22

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions