Updating to latest CSP Auth API
This commit is contained in:
@@ -21,8 +21,7 @@
|
||||
[Parameter(Mandatory=$true)][String]$RefreshToken
|
||||
)
|
||||
|
||||
$body = "refresh_token=$RefreshToken"
|
||||
$results = Invoke-WebRequest -Uri "https://console.cloud.vmware.com/csp/gateway/am/api/auth/api-tokens/authorize" -Method POST -ContentType "application/x-www-form-urlencoded" -UseBasicParsing -Body $body
|
||||
$results = Invoke-WebRequest -Uri "https://console.cloud.vmware.com/csp/gateway/am/api/auth/api-tokens/authorize" -Method POST -Headers @{accept='application/json'} -Body "refresh_token=$RefreshToken"
|
||||
if($results.StatusCode -ne 200) {
|
||||
Write-Host -ForegroundColor Red "Failed to retrieve Access Token, please ensure your VMC Refresh Token is valid and try again"
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user