Keycloak: Could not find resource for full path

Viewed 10007

I am trying to get the REST API of keycloak to work.

Thanks to this post I was able to get the token. But when trying the example for the list of users in the first answer, I get the error:

"error": "RESTEASY003210: Could not find resource for full path: http://PATHTOCEAKLOAK:81/auth/user/realms/master/users"

Here my request with Postman:

enter image description here

As I am using a Bitnami-container the admin is called user that's why I am using /auth/user/ instead of /auth/admin/

5 Answers

For those who are still facing this error and using 17.0+ version of Keycloak, there's a change in endpoints as per the official documentation. I resolved this issue by just using {realm}/user and omitting /auth in between.

In addition to @Akanksha_p's answer, here is a command to get the token using curl:

curl -k -H "Content-Type: application/x-www-form-urlencoded" -d "client_id=your-client" -d "username=some-user" -d "password=hardpassword" -d "grant_type=password" -X POST https://your.fqdn.server:8443/realms/yourrealm/protocol/openid-connect/token

@Kostanos - I will try to get the /auth/ Path back with a reverseproxy in front of the keycloak. Like nginx and make a rewrite

I was actually working on the same and using docker image of bitnami/keycloak:latest

it worked with just removing /auth from base path and keeping it as /admin

something like this (GET http://localhost:8085/admin/realms/test-realm/users)

enter image description here

If you want to know wich url are available on your current realm you can go in Realm -> Settings and click on "Ednpoints" link.

Or directly go to the following url : http://{host}:{port}/realms/{your_realm}/.well-known/openid-configuration.

Related