[keycloak-user] getting keycloak token with curl from PC

John Norris johnnorris-10 at outlook.com
Mon Nov 25 03:34:39 EST 2019


Hello,
I have keycloak running on a linux server along with a web application.
Using a browser from a PC, I get redirected to the keycloak login page where I can authorise a user and so get access to protected resource.
I can also use curl on the command line on the server to get back and display the token.

But what I can not do is use curl on the PC (or Postman which I used initially) to get the token. I run the same curl command (except for using double quotes for the body on the PC) but on the PC I get

curl -s -X POST -H 'Content-Type: application/x-www-form-urlencoded' -d "username=user1&grant_type=password&client_id=bikes-app&password=123456" http://mint191:8080/auth/realms/master/protocol/openid-connect/token
{"error":"unauthorized_client","error_description":"INVALID_CREDENTIALS: Invalid client credentials"}

So why would a locally run curl work but a remotely run curl fail when the browser works?

Regards,
John




More information about the keycloak-user mailing list