How to get Access Token Version 2.0

Shweta Mathur 29,856 Reputation points Microsoft Employee
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 Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,172 questions
{count} votes

Accepted answer
  1. Siva-kumar-selvaraj 15,651 Reputation points
    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 66 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 Answers by the question author, which helps users to know the answer solved the author's problem.