0
votes

I'm trying to authenticate to Graph using Postman. I have the following request:

Type: Post Url: https://login.microsoftonline.com/[MyTenantIdHere]/oauth2/v2.0/token

Body = Raw:

{
  client_id: "[MyClientID]",
  grant_type: "client_credentials",
  scope: "https%3A%2F%2Fgraph.microsoft.com%2F.default",
  client_secret: "[MyClientSecret"
}

However, I'm getting this error:

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

Any idea how to solve this?

1
can you please try with curl curl -X POST -d “grant_type=client_credentials&client_id=clientid&client_secret=secret&scope= https%3A%2F%2Fgraph.microsoft.com%2F.default” https://login.microsoftonline.com/tenantid/oauth2/v2.0/token and let us know if it helps.Sruthi J
It works with this format, I guess it doesn't accept JSON.B1B

1 Answers

0
votes

Try X-www-form-urlencoded in postman.

enter image description here