Microsoft Defender for Endpoint - Security Graph API

Mohammed Ally 40 Reputation points
2023-04-23T14:52:45.76+00:00

trying to make API calls to the Security Graph API to retrieve security alerts. ERROR: The remote server returned an error: (403) Forbidden.. I granted Admin Consent to the scopes requested. when I make API calls to get my profile info etc. it works, only security data shows the permission error.

Microsoft Security Microsoft Graph
{count} votes

Accepted answer
  1. CarlZhao-MSFT 46,366 Reputation points
    2023-04-24T06:17:50.2033333+00:00

    Hi @Mohammed Ally

    The audience of your access token is not the graph API, which causes the graph permission you grant to your application in Azure AD to not be mapped to the token.

    Go to Azure AD>App registrations > find your app >API permissions.

    6

    Then change the scope to https://graph.microsoft.com/.default when getting the access token.

    2

    Decode token:

    7

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.


0 additional answers

Sort by: Most helpful

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.