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
| $region = Read-Host "Enter a region, e.g., CA" | |
| $client_id = Read-Host "Enter the client_id" | |
| $client_secret = Read-Host "Enter the client_secret" -AsSecureString | |
| $response_type = "code" | |
| $scope = Read-Host "Enter *SPACE* separated scope, e.g., control management monitoring" | |
| $scope = [uri]::EscapeDataString($scope) #this encoded right | |
| $plain_client_secret = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($client_secret)) | |
| $redirect_uri = Read-Host "Enter the route from app registration, e.g., https://localhost *OR* https://webhook.site/00000000-0000-0000-0000-000000000000" | |
| $uri = "https://$($region).ninjarmm.com/oauth/authorize?" + |