How to get Access Token Version 2.0

Shweta Mathur 30,431 Reputation points Microsoft Employee Moderator
2021-11-24T16:59:55.607+00:00

Hi, I'm not able to get v2.0 access token. It always return v1.0 access token.
As per document https://learn.microsoft.com/en-us/azure/active-directory/develop/reference-app-manifest#accesstokenacceptedversion-attribute . This depends on the value of "accessTokenAcceptedVersion" parameter in the Manifest of the API.

I updated the value in manifest to 2 as below and use endpoint https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token

"accessTokenAcceptedVersion": 2,  
"addIns": [],  
"allowPublicClient": null,  
"appId": "49f9xxxx-xxx-xxx-xx-xxxfd5",  

but I am still getting version 1.0 in access token as below:

"appid": "49f9xxxx-xxx-xxx-xx-xxxfd5",
"ver": "1.0",

Could you please help what I am missing here or is there any other value I need to set in manifest to get V2.0.

Microsoft Security | Microsoft Entra | Microsoft Entra ID
{count} votes

Answer accepted by question author
  1. Siva-kumar-selvaraj 15,731 Reputation points Volunteer Moderator
    2021-11-25T11:39:46.887+00:00

    Hello @Shweta Mathur ,

    Thanks for reaching out.

    You have to make sure the accessTokenAcceptedVersion is set to 2 for the resource app (Web API) for which you are requesting the access token, and you need specify your resource app (Web API) as audience in the scope parameter while requesting token (For an example: scope=https://contosoApp.com/tasks.read ) as shown below, but if you use Microsoft web-hosted resources in the scope parameter such as Microsoft Graph: https://graph.microsoft.com / Microsoft SharePoint: https://microsoft.sharepoint-df.com etc.., then V2.0 version token doesn't support yet.

    152519-untitled.png

    Outcome from my tenant Tenant:

    An access token request call and decoded V2.0 version token

    152614-image.png

    152555-image.png

    Hope this helps.

    ------
    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Desmond Sindatry 91 Reputation points
    2023-03-23T15:31:35.5633333+00:00

    How to update "accessTokenAcceptedVersion": 2 programatically using azure ad ?

    0 comments No comments

Your answer

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