Forum Discussion
AndrewX
Feb 09, 2019Iron Contributor
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...
- 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 = $HeadersMethod = 'Get'ContentType = 'application/json'}Invoke-RestMethod @RestSplat... a bit redacted but you get the gistEDIT: Granting Application Permissions instead of Delegate Permissions enabled me to return dataagain this is for Secure Score but worth noting
Kevin Blumenfeld
Feb 23, 2019Copper Contributor
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