From 4a0e2c0c80127924aca529f3f8d9ddfbc631ed2e Mon Sep 17 00:00:00 2001 From: Skatterbrainz Date: Tue, 3 Nov 2020 19:25:08 -0500 Subject: [PATCH] Updated _oktaMakeCall() to include UseBasicParsing Updated function _oktaMakeCall() to include -UseBasicParsing to enable the connection to work under invocation as NT AUTHORITY\SYSTEM context. --- Okta.psm1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Okta.psm1 b/Okta.psm1 index 00beb5c..14b95c1 100644 --- a/Okta.psm1 +++ b/Okta.psm1 @@ -456,10 +456,10 @@ function _oktaMakeCall() { $postData = ConvertTo-Json $body -Depth 10 Write-Verbose($postData) - $request2 = Invoke-WebRequest -Uri $uri -Method $method -UserAgent $userAgent -Headers $headers ` + $request2 = Invoke-WebRequest -Uri $uri -Method $method -UserAgent $userAgent -UseBasicParsing -Headers $headers ` -ContentType $contentType -Verbose:$oktaVerbose -Body $postData -ErrorVariable evar -SessionVariable Global:myWebSession } else { - $request2 = Invoke-WebRequest -Uri $uri -Method $method -UserAgent $userAgent -Headers $headers ` + $request2 = Invoke-WebRequest -Uri $uri -Method $method -UserAgent $userAgent -UseBasicParsing -Headers $headers ` -ContentType $contentType -Verbose:$oktaVerbose -ErrorVariable evar -SessionVariable Global:myWebSession } } else { @@ -467,10 +467,10 @@ function _oktaMakeCall() { $postData = ConvertTo-Json $body -Depth 10 Write-Verbose($postData) - $request2 = Invoke-WebRequest -Uri $uri -Method $method -UserAgent $userAgent -Headers $headers ` + $request2 = Invoke-WebRequest -Uri $uri -Method $method -UserAgent $userAgent -UseBasicParsing -Headers $headers ` -ContentType $contentType -Verbose:$oktaVerbose -Body $postData -ErrorVariable evar -WebSession $Global:myWebSession } else { - $request2 = Invoke-WebRequest -Uri $uri -Method $method -UserAgent $userAgent -Headers $headers ` + $request2 = Invoke-WebRequest -Uri $uri -Method $method -UserAgent $userAgent -UseBasicParsing -Headers $headers ` -ContentType $contentType -Verbose:$oktaVerbose -ErrorVariable evar -WebSession $Global:myWebSession } }