Héctor Valls
Héctor Valls

Reputation: 26084

OAuth2 server: invalid or missing grant_type parameter

I have a NodeJS-based OAuth2 server (using oauth2-server module) started in my LAN. I want to test it with Postman REST Client but I'm getting this error response:

{
    "code": 400,
    "error": "invalid_request",
    "error_description": "Invalid or missing grant_type parameter"
}

This is my request configuration:

Request

I have tried to send the parameters by URL but I get the error: Method must be POST with application/x-www-form-urlencoded encoding.

Thanks.

Upvotes: 2

Views: 2740

Answers (1)

Subham
Subham

Reputation: 1465

Using postman you send the value as a query parameter but 'oauth2-server' checks the value as a body parameter using 'req.body'.so try to send the value as a body parameter or change the req.body to req.query inside node_modules/oauth2-server/lib/grant.js

Upvotes: 1

Related Questions