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

Sebastien Blanc sblanc at redhat.com
Mon Nov 25 05:05:28 EST 2019


The error "unauthorized_client" seems to indicate that you are using a
confidential client and you didn't provide any credentials for it. Not sure
why it was working for you on the server directly.


On Mon, Nov 25, 2019 at 9:37 AM John Norris <johnnorris-10 at outlook.com>
wrote:

> 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
>
>
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user
>
>


More information about the keycloak-user mailing list