You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to use Invoke-MgGraphRequest with api.securitycenter and it doesn't work. It works using old MSAL.PS methods so I would guess it's the same thing. Is that expected?
Connect-MgGraph-Scopes 'User.Read.All','Directory.Read.All','SecurityIdentitiesHealth.Read.All','SecurityAlert.Read.All'-NoWelcome
# worksInvoke-MgGraphRequest-Uri "https://graph.microsoft.com/v1.0/users"-Method Get -Verbose
# doesn't workInvoke-MgGraphRequest-Uri "https://api.securitycenter.microsoft.com/api/alerts"-Method Get -Verbose
Expected behavior
Invoke-MgGraphRequest should work with all URL's
How to reproduce
Connect-MgGraph-Scopes 'User.Read.All','Directory.Read.All','SecurityIdentitiesHealth.Read.All','SecurityAlert.Read.All'-NoWelcome
# worksInvoke-MgGraphRequest-Uri "https://graph.microsoft.com/v1.0/users"-Method Get -Verbose
# doesn't workInvoke-MgGraphRequest-Uri "https://api.securitycenter.microsoft.com/api/alerts"-Method Get -Verbose
Describe the bug
I was trying to use Invoke-MgGraphRequest with api.securitycenter and it doesn't work. It works using old MSAL.PS methods so I would guess it's the same thing. Is that expected?
Expected behavior
Invoke-MgGraphRequest should work with all URL's
How to reproduce
SDK Version
2.23.0
Latest version known to work for scenario above?
No response
Known Workarounds
MSAL.PS module
Debug output
Click to expand log
``` Invoke-MgGraphRequest : GET https://api.securitycenter.microsoft.com/api/alerts HTTP/1.1 401 Unauthorized Transfer-Encoding: chunked Connection: keep-alive Strict-Transport-Security: max-age=31536000; includeSubDomains Date: Fri, 20 Sep 2024 10:37:16 GMT WWW-Authenticate: Bearer Content-Type: application/json; charset=utf-8 {"error":{"code":"Unauthorized","message":"Invalid Authorization payload.","target":"|bacd29ce-4fb3ae258a3201fc."}} At C:\Support\GitHub\GraphEssentials\Examples\GraphTest.ps1:5 char:1 + Invoke-MgGraphRequest -Uri "https://api.securitycenter.microsoft.com/ ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (Method: GET, Re...4ea93e814321 }:HttpRequestMessage) [Invoke-MgGraphRequest], HttpResponseException + FullyQualifiedErrorId : InvokeGraphHttpResponseException,Microsoft.Graph.PowerShell.Authentication.Cmdlets.InvokeMgGraphRequest ```Configuration
Other information
Not relevant
The text was updated successfully, but these errors were encountered: