Keycloak Missing form parameter: grant_type
2022-08-31 16:50:51
I have keycloak standalone running on my local machine.
I created new realm called 'spring-test', then new client called 'login-app'
According to the rest documentation:
POST: http://localhost:8080/auth/realms/spring-test/protocol/openid-connect/token
{
"client_id": "login-app",
"username": "user123",
"password": "pass123",
"grant_type": "password"
}
should give me the jwt token but I get bad request with response
{
"error": "invalid_request",
"error_description": "Missing form parameter: grant_type"
}
I am assuming that something is missing in my configuration.
EDIT:
I was using json body but it should be :
the following body works:application/x-www-form-urlencoded
token_type_hint:access_token&token:{token}&client_id:{client_id}&client_secret:{client_secret}