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

My question:
I am trying to get access token but I am stuck with this error:

AADSTS900144: The request body must contain the following parameter: ‘grant_type’.

Details (like screenshots):

How I found the problem:
I am trying to create an API for integrating SharePoint with Control-M. I came across this video and followed through: How To Test SharePoint Online REST API Using Postman - YouTube

I have inputted ‘grant_type’ correctly even before the tutor notices the typo, but upon sending the request, I still get AADSTS900144 error.

I’ve already tried:

  1. Placing ‘grant_type’ and all variables on Params, it resulted to a different error:

AADSTS900561: The endpoint only accepts POST requests. Received a GET request.

So I tried to change the request to POST, but it returned the previous error:

AADSTS900144: The request body must contain the following parameter: ‘grant_type’

  1. I also tried other solutions from forums such as allow third-party cookies. After restarting the browser, it still yield the same error (AADSTS900144: The request body must contain the following parameter: ‘grant_type’.)

  2. I also tried placing all those variables through x-www-form-urlencoded, but still gives me the same error (AADSTS900144: The request body must contain the following parameter: ‘grant_type’.)

  3. I tried to redo the steps - delete the permissions from Site Collection App Permissions, delete the requests (from Postman), then start again as clean slate. But, still stuck at the same spot.

Is there anything that should be done from SharePoint side? Is my endpoint correct? (I am using my SharePoint provided by the company)

PS: I am using the web-based Postman

Thanks in advance!

From what I’m finding online, the outgoing content type header must be set to Content-Type: application/x-www-form-urlencoded … can you confirm that this is being set properly in the Headers section of the Postman interface? Can you also post a screenshot of the Postman console and expand the outgoing request to make sure it’s actually setting this properly?

I got this fixed by using the Desktop App :sweat_smile: