I have tried to access the keycloak API from the postman. but it is showing 400 bad request.
I was calling api in the below format.
http://{hostname}:8080/auth/realms/master/protocol/openid-connect/token?username=admin&password=admin&client_id=admin-cli&grant_type=password
In the headers I have set the content_type as application/x-www-form-urlencoded
I am getting the response as below.
{
"error": "invalid_request",
"error_description": "Missing form parameter: grant_type"
}
Can any one help me.Any help will be appreciated. thanks in advance
Navigate to the Postman Authorization tab of your request. From the Type dropdown menu, select OAuth 2.0: Click on the Get New Access Token button that will open a dialog box for configuring the identity server (Keycloak in our case).
A bit late for this question, but you did ask about postman and not curl. So you have to put the options in x-www-form-urlencoded
You call API through POST client
URL - http://localhost:8080/auth/realms/Demo/protocol/openid-connect/token
So here in above url i am using Demo
as my realm instead of master
.
ContentType - "Content-Type":"application/x-www-form-urlencoded"
Params:
{
"client_secret" : "90ec9638-7647-4e65-ad20-b82df3341084",
"username" : "ankur",
"password" : "123456",
"grant_type" : "password",
"client_id": "app-client"
}
Set Header as below
Data Need to be passed as shown below
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With