0
votes

I'm using Azure AD to provide Oauth2 auth for an API. Setup & config seemed to work fine for me, but a partner pointed out that the Oauth2 token endpoint doesn't like inline parameters -- it wants params passed in the HTTP body instead.

Ex: this call returns AADSTS90014: The request body must contain the following parameter: 'grant_type':

https://login.microsoftonline.com/my tennant/oauth2/token?grant_type=client_credentials&client_id=theclientid&client_secret=thesecret&code=AUTHORIZATION_CODE'

But a post w/ the same params in the body as form data works just fine. I believe Oauth is supposed to supposed to support the parameterized call (as shown in google documentation).
Is there somewhere in Azure to configure the Oauth2 endpoint to accept token parameters as post params vs. sending in the form body?

1

1 Answers

0
votes
he request body must contain the following parameter: 'grant_type':

Based on the response I would say you are setting the content-type header wrongly.

If you are posting this request : https://login.microsoftonline.com/my tennant/oauth2/token?grant_type=client_credentials&client_id=theclientid&client_secret=thesecret&code=AUTHORIZATION_CODE' ensure that you are setting the content-type as application/x-www-form-urlencoded.

If you are the parameters in the body set the content-type as application/json