Created
February 19, 2024 13:11
-
-
Save m8r1us/0fe307dbbc162f12706dba2f43ec9c4e to your computer and use it in GitHub Desktop.
MSGRAPH to AzureManagementToken
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$TenantId = "" | |
$authUrl = "https://login.microsoftonline.com/$($TenantId)" | |
$body = @{ | |
"scope" = "https://management.azure.com/.default offline_access openid" | |
"client_id" = "d3590ed6-52b3-4102-aeff-aad2292ab01c" | |
"grant_type" = "refresh_token" | |
"refresh_token" = "" | |
} | |
$token = Invoke-RestMethod -UseBasicParsing -Method Post -Uri "$($authUrl)/oauth2/v2.0/token" -Headers $Headers -Body $body |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment