I'm trying to get a list of users by a specific role using but I get a 403 forbidden error using a custom-client generated access token
GET: http://localhost:8080/admin/realms/{realm}/clients/8cf0e750-6805-46e9-a9b9-a33b1340b175/roles/{role}/users
The strange thing is when I use an access token generated by the keycloak API (client_id: admin-CLI
), with the same user credentials (POST: http://localhost:8080/realms/{realm}/protocol/openid-connect/token
) to get the list of users, it works!
The decoded JWT token structure is a bit different but I want to understand why the token generated for the admin-CLI
client works and the one generated for my custom client doesn't.