Search code examples
oauth-2.0jwtazure-active-directorypostman

How to get a v2 jwt token when authorizing against AzureAD in Postman


I'm able to get a v1.0 jwt token with the below settings.

How do I make the https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/authorize endpoint return v2.0?

enter image description here


Solution

  • First we need to create app in ad with "Supported account types" as Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox).(when we choose this option, the property accessTokenAcceptedVersion in its Manifest will be 2). enter image description here

    Then we need to add a scope in it, and when we request the access token, we need to use openid api://xxxxxx/User.read instead of only openid in postman as the screenshot you provided.

    After that, we can request the access token(v2) enter image description here

    Parse the access token, it will show v2. enter image description here

    Update about how to add scope:

    We can add the scope in app on portal(shown as screenshot below): enter image description here

    enter image description here

    enter image description here

    Then we can copy the scope directly from here as below: enter image description here