Gary Mc
Gary Mc

Reputation: 71

Get an Auth code from ms graph for an application - returning error about missing request_type

I am creating a Power Automate flow to get MS Booking information. Having trouble with getting an Authorization using https://login.microsoftonline.com/***TENANT ID****/oauth2/token. I receive an error that I am missing grant_type although I supply it. I registered the app in azure, the HTTP request in power automate looks like this:

enter image description here

{ "uri": "https://login.microsoftonline.com//oauth2/token", "method": "POST", "headers": { "content-type ": "application/x-www-form-urlencoded" }, "body": "client_id=&resource=https://graph.microsoft.com&grant_type=password&client_secret=&username=username&password=password"

I receive the error: {"error":"invalid_request","error_description":"AADSTS900144: The request body must contain the following parameter: 'grant_type'.

Anyone have an idea what I am doing wrong or missing? Thank you in advance.

Upvotes: 0

Views: 251

Answers (1)

Gary Mc
Gary Mc

Reputation: 71

Just a quick follow-up. Thanks Expiscornpvus, you pointed me in the right direction, although there were spaces after the content type header, I corrected this and things worked well

Upvotes: 0

Related Questions