postmankeycloakkeycloak-serviceskeycloak-rest-apiclientcredential

How can I create a client_credential account in to be able to perform administrative tasks?


I'm trying to achieve the same exact thing of this user but using a client with client_credentials

I've followed this post to create my client with client credentials grant and so I can get the access token like this

enter image description here

but when I try to call the execute-action-email api I only get an error 401

enter image description here

what am I missing?


Solution

  • Try to get the token from a user with the correct permissions for instance the master admin:

    curl -k -sS     -d "client_id=admin-cli"
                    -d "username=$ADMIN_NAME"
                    -d "password=$ADMIN_PASSWORD"
                    -d "grant_type=password"
                    http://$KEYCLOAK_IP/auth/realms/master/protocol/openid-connect/token)
    

    Alternatively, what you can do is: