Microsoft Graph API unable to get access token, token URL tells me to use /consumers route

Karan Sharma 21 Reputation points
2021-05-25T19:41:50.017+00:00

Hi, I have created an app in Azure portal using my personal outlook account, I am creating a test app, I have add all the permissions to my app as shown here,
99535-screenshot-5.png

99586-screenshot-6.png

99597-screenshot-7.png

Now I am trying to access the API using postman, however, I am unable to get the correct access token. I keep getting an error stating to use /consumers route. Can anyone assist me with the correct url, I am using the following URL to get the access token: https://login.microsoftonline.com{TenantID}}/oauth2/v2.0/token/
Below is the screenshot of the error.
99528-screenshot-4.png
/api/attachments/99528-screenshot-4.png?platform=QnA

However when I use Microsoft Graph Explorer I am able to access all the routes via just logging in, Also I tried using the link https://login.microsoftonline.com/{tenant-id}/adminconsent?client_id={client-id}&state={random-string}&redirect_uri={redirect-url} to login in my app but I get the error as below
99621-screenshot-8.png

Microsoft Security Microsoft Entra Microsoft Entra ID
0 comments No comments
{count} votes

Accepted answer
  1. VipulSparsh-MSFT 16,311 Reputation points Microsoft Employee
    2021-05-27T04:40:06.143+00:00

    @Karan Sharma Thanks for confirming. If you have registered the app just for personal accounts. Then you will need to use the following endpoints :
    https://login.microsoftonline.com/consumers/oauth2/v2.0/token

    So under postman, change the URL to reflect above URL while posting.

    You can check other endpoints here for the app :

    100049-image.png

    -----------------------------------------------------------------------------------------------------------------

    If the suggested response helped you resolve your issue, please do not forget to accept the response as Answer and "Up-Vote" for the answer that helped you for benefit of the community


1 additional answer

Sort by: Most helpful
  1. Karan Sharma 21 Reputation points
    2021-05-26T13:56:14.29+00:00

    Hi @VipulSparsh-MSFT ,
    I only have personal Microsoft account option available in my authentication blade since I am using my personal account for testing
    99828-image.png

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.