"AADSTS900144: The request body must contain the following parameter: 'grant_type'.?

Viewed 13619
4 Answers

One thing I noticed is that the parameters for the token request should be in the body as form parameters, like this:

Parameters in Body tab of Postman with x-www-form-urlencoded selected

You should use the parameters you've defined here though, this screenshot shows a test request for the ROPC flow so the parameters in the picture are not valid for your use case.

So instead of entering the parameters in Params, enter them in Body tab after selecting x-www-form-urlencoded as the type.

Please input the params in "Body" tab of your postman but not "Params" tab. Shown as below screenshot.

enter image description here

In order to get token you need to pass grant_type in request body and value should be password.

For example

Method Post: https://login.microsoftonline.com/YourTenantID/oauth2/v2.0/token

And in body you need to ppass client_id : Your app client ID scope: user.read%20openid%20profile%20offline_access username: Your username password: your password grant_type: password client_secret: you app registration secret

I tried many times to put into body with JSON format or in parameter or put into Parameters, but I did not work. And it works for me when I put into Body with type is x-www-form-urlendcoded. [Image]: https://i.stack.imgur.com/tguZc.png

Related