skip to Main Content

Today, I have an issue getting an Azure AD access token from Postman. This is while it was working before for the same app and other apps I am working on. But none of them are working today.
I was working correctly, but now it shows me this error:

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

I use https://login.microsoftonline.com/common/oauth2/v2.0/authorize as auth URL, and https://login.microsoftonline.com/common/v2.0/token for Access token URL.
I have tried these for access token URL but none of them worked. https://login.microsoftonline.com/{{tenant_id}}/v2.0/token
https://login.microsoftonline.com/common/token
https://login.microsoftonline.com/{tenant_id}/token
here is my Azure AD oauth 2.0 configuration. Also, as you see, there is no client_id in the request body.
enter image description here

enter image description here

2

Answers


  1. Chosen as BEST ANSWER

    I found out why it's acting like this: I checked my friend's PC, and it was working there! The issue was the last update of Postman. They have changed something in authorization. just change the Client Authentication to Send client credentials in body and it will work. enter image description here


  2. I tried to reproduce the same in my environment and got below results

    You can get values of auth URL and access token URL from your Azure AD application that varies based on supported account type like below:

    Go to Azure Portal -> Azure Active Directory -> App registrations -> Your App -> Overview -> Endpoints

    enter image description here

    Now I added environment variables in Postman by defining them like below:

    enter image description here

    Make sure to select the correct Environment while requesting for token with variables.

    I filled the required details same as you to get the access token like below:

    enter image description here

    When I selected Get New Access Token, I got the token successfully as below:

    enter image description here

    The error usually occurs if you missed including client_id while
    acquiring access token.

    I changed client_id parameter to blank in variables like below:

    enter image description here

    When I tried to get access token again, I got same error as you like below:

    enter image description here

    To resolve the error, make sure to pass client_id value in right environment and save it.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search