How to get MSAL V2.0 access token?

Yash Patel 1 Reputation point
2021-09-29T09:55:21.827+00:00

I'm not able to get v2.0 access token. It always return v1.0 access token.
I have created app for any organizational directory and personal acccount to sync calednar. It is working fine for organizational account but it is not working for personal account.
I read document, as per document you should set accoount type as any organizational directory and personal acccount and I have set that and also use endpoint as:
https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/authorize
https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token

But it is not working at all. It always return v1.0 access token not v2.0.

How to get v2.0 access token? Please help, it will be appreciated.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,389 questions
{count} votes

1 answer

Sort by: Most helpful
  1. AmanpreetSingh-MSFT 56,301 Reputation points
    2021-09-29T10:45:55.863+00:00

    Hi @Yash Patel • Thank you for reaching out.

    This depends on the value of "accessTokenAcceptedVersion" parameter in the Manifest of the API/resource you request the token for. E.g. if you request an access token for API1 whose accessTokenAcceptedVersion is set to null or 1, you will get access token v1.0, if you change accessTokenAcceptedVersion to 2 for API1, the token version will be v2.0.

    So, it is configurable only when you have access to the manifest of the api/resource for which the token is to be acquired.

    Read More: https://learn.microsoft.com/en-us/azure/active-directory/develop/reference-app-manifest#accesstokenacceptedversion-attribute

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

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

    0 comments No comments