3
votes

I have registered the angular application in the portal and using adal-angular4 (https://www.npmjs.com/package/adal-angular4) library to retrieve the access token. While trying to call the Microsoft graph API https://graph.microsoft.com/v1.0/me with the access token in the header, receiving the error as 'Access token validation failure'.

{
"error": {
    "code": "InvalidAuthenticationToken",
    "message": "Access token validation failure.",
    "innerError": {
        "request-id": "722c9af9-f13b-4d0a-adbe-83ec349e0d16",
        "date": "2017-08-28T04:40:12"
    }
}
}
1
You can try to decode the access token from this site and what's aud claim in the token?Fei Xue - MSFT
It shows the aud claim as my client id (Guid) and not 'graph.microsoft.com'Harish
The token is incorrect, you should acquire the token for Microsoft Graph. Refer this link.Fei Xue - MSFT

1 Answers

1
votes

The token you got is probably just a token for your application.

All tokens for the Graph API should have an Audience of https://graph.microsoft.com. To check this you can copy the token and paste it on https://jwt.ms (a Microsoft created page to check JWT tokens).

This answer might steer you in the right direction. Also be sure to request a Microsoft Graph api Scope.