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 application/x-www-form-urlencoded
:
the following body works:
token_type_hint:access_token&token:{token}&client_id:{client_id}&client_secret:{client_secret}
question from:
https://stackoverflow.com/questions/53795179/keycloak-missing-form-parameter-grant-type 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…