Invoke-Web Request Examples?

If -Authentication does not work I would recommend making the Authorization header yourself.

This can be done by doing the follow:

$url = "$ConjurApplianceUrl/authn/$ConjurAccount/login"
$method = "GET"
$base64 = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $ConjurUsername, $ConjurPassword)))
$basicAuthHeader = @{"Authorization"="Basic $base64"}
$response = Invoke-RestMethod -Uri $url -Method $method -Header $basicAuthHeader

Hopefully that helps.

Regards,
Andrew

1 Like