Skip to content

Instantly share code, notes, and snippets.

View nimdaus's full-sized avatar
🏗️

Josh nimdaus

🏗️
View GitHub Profile
$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?" +