[keycloak-user] grant_type is not provided in the POST request call
aliartiza75
iali at an10.io
Mon Jul 2 05:28:38 EDT 2018
Hello everyone,
I am trying to authenticate the user using this endpoint:
http://localhost:8080/auth/realms/nodejs-example/protocol/openid-connect/token
When I use the curl request:
/**** Request Example *****/
curl -d "client_secret=17823f90-c7c5-4f07-a78d-f7632a8dee16" -d
"client_id=nodejs-connect" -d "username=XXX" -d "password=XXX" -d
"grant_type=password"
"http://localhost:8080/auth/realms/nodejs-example/protocol/openid-connect/token"
I am able to authenticate the user and get the response in JSON format.
But when I try to do the same thing using the node requestify module, it
raises the grant_type not provided issue:
/**** Code Example *****/
var requestify = require('requestify');
requestify.post('http://localhost:8080/auth/realms/nodejs-example/protocol/openid-connect/token',
{
client_secret:'17823f90-c7c5-4f07-a78d-f7632a8dee16',
client_id: 'nodejs-connect',
username: 'XXX',
password: 'XXX',
grant_type: 'password'
})
.then(function(response) {
console.log(response.getBody());
}).catch((e) => {
console.log(e);
});
The same issue is also generated which I use postman to do perform the same
task.
Is this issue is related to keycloak or on my side.
Thankyou.
--
Sent from: http://keycloak-user.88327.x6.nabble.com/
More information about the keycloak-user
mailing list