Cannot authenticate a POST request with 'x-www-form-urlencoded'
satabdisikdar opened this issue · 2 comments
satabdisikdar commented
Code I am using
supertest(app).post(endpoint).type('form').send(authToken).expect(200).then((response)=>{ console.log(response.body.access_token); });
authToken data passed is-
let authToken = { grant_type:password username:{{email}} password:{{password}} audience:{{auth0_audience}} client_id:{{auth0_client_id}} };
I get 401 unauthorized.
satabdisikdar commented
titanism commented
This is not an issue with supertest
nor superagent
, it is an issue with your usage or the endpoint/server.
Try with curl
to see that it's not an issue with this package.