Graph API Beta - Analyzed Email Remediate

mjhelmb 15 Reputation points
2024-04-16T15:52:39.79+00:00

Receive the following error when attempting to POST to https://graph.microsoft.com/beta/security/collaboration/analyzedEmails/Remediate

"WWW-Authenticate": "Bearer error=\"invalid_token\", error_description=\"S2S17001: SAL was able to validate the protocol, but validation failed as none of the inbound policies were satisfied. Validation failures: 'd0b0e89f-0197-499f-894f-e787c44d6aee: InvalidAudience.\"",

I am able to successfully Get https://graph.microsoft.com/beta/security/collaboration/analyzedEmails using the same bearer token.

Bearer token payload has:

"aud": "https://graph.microsoft.com",

Role: "SecurityAnalyzedMessage.ReadWrite.All"

Ideas? Thank you.

Microsoft Security | Microsoft Graph
{count} votes

1 answer

Sort by: Most helpful
  1. Cam Murray 0 Reputation points Microsoft Employee
    2024-10-20T03:41:24.2666667+00:00

    Hi Matthew and Lachlan,

    Thanks for your patience here. On further investigation this isn't to do with our API but around how some applications, like Azure Logic Apps, consider a 302 redirect.

    Are you using logic apps or something else?

    I'll speak specifically about logic apps here as it is first party, logic apps considers 302 to be an error and doesn't handle the redirect.

    For logic apps, it's as simple as handling the 302 redirect.

    Place a child condition element after your action, like below:

    User's image

    Set the condition to status code is 302, and in the settings tab, in the run after, specify to handle the error by selecting it to run when the parent element has "failed":
    User's image

    In your TRUE statement for the redirect, fetch the URL specified in the location header like so:

    User's image

    Let me know if you have any further issues!

    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.