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

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


Hi Sebastien,
What do you mean by confidential client - client as in curl? Client as in the client within keycloak? If latter, then should look to the client details within keycloak admin?
John

Get Outlook for Android<https://aka.ms/ghei36>

________________________________
From: Sebastien Blanc <sblanc at redhat.com>
Sent: Monday, November 25, 2019 10:05:28 AM
To: John Norris <johnnorris-10 at outlook.com>
Cc: keycloak-user at lists.jboss.org <keycloak-user at lists.jboss.org>
Subject: Re: [keycloak-user] getting keycloak token with curl from PC

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



More information about the keycloak-user mailing list