Invalid Audience for Resource (O365/Outlook API)

Byron Hayes 41 Reputation points
2020-02-18T14:25:59.79+00:00

So I created/registered an app. But no where in this app registration can I state that it is an outlook application.
Otherwise, I am able to get a token but the token does not work on outlook endpoints. Need help for the error

'Invalid Audience for Resource"{"error":{"code":"InvalidAudienceForResource", "message":"The audience claim value is invalid for current resource. Audience claim is 'api://OUR-APP-ID_SET-AS-SCOPE', request url is 'https://outlook.office.com/api/v2.0/me/messages' and resource type is 'Exchange'.", "innerError": {"requestId": "c7fe963f-a7cb-4c1f-a869-83402fdeee76","date":"2020-02-11T03:55:07}}}

Note, I tried updating the scope in the call and because it isn't like the app-id it won't allow that. tried adding the outlook scope 'mail.read' to the app and said it is owned by Microsoft. Not sure how to move forward an update scope, or if that is the issue at all.

Azure Information Protection
Azure Information Protection
An Azure service that is used to control and help secure email, documents, and sensitive data that are shared outside the company.
523 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,140 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Vasil Michev 98,196 Reputation points MVP
    2020-02-21T07:03:06.873+00:00

    Try using 'https://outlook.office365.com' as the audience value.