Forum Discussion

AndrewX's avatar
AndrewX
Iron Contributor
Feb 09, 2019
Solved

403 Forbidden response when requesting Microsoft Security Graph API

Hello, i am developing an app, nodejs, and running into http 403 when calling the https://graph.microsoft.com/v1.0/security/alerts endpoint.   I have assigned myself and my app the `security reader...
  • Kevin Blumenfeld's avatar
    Feb 23, 2019

    I too am getting 403 using PowerShell while taking the same steps.  The same code works for other applications, such as fetching email from exchange mailbox folders

     


    $Headers = @{
    "Authorization" = "Bearer $Token"
    }

    $RestSplat = @{
    Uri = 'https://graph.microsoft.com/beta/security/secureScores?$top=5'
    Headers = $Headers
    Method = 'Get'
    ContentType = 'application/json'
    }
     
    Invoke-RestMethod @RestSplat
     
    ... a bit redacted but you get the gist
     
    EDIT: Granting Application Permissions instead of Delegate Permissions enabled me to return data
    again this is for Secure Score but worth noting

Resources