Greetings.
I have a requirement to create some Solarwinds http script monitors using Bearer token authentication. The script monitors will use the Powershell Invoke-WebRequest applet to execute the request.
"generic" way to represent the authentication portion of the Invoke-WebRequest looks like this:
$header = @{
"Authorization"="Bearer <loooooooong string of hex digits>"
}
However, for this application I want to put the looooooooong string of digits into the Solarwinds credential store (you can create a credential with a Bearer token).
Trying to figure out the best way to reference the credential store entry in the $header section of the web request rather than entering the long hex string itself in the $header.
I'm thinking about the Parameters section of the script monitor (above the script code itself). Something like '-Authorization <name of credential>'.
I welcome any input from the community about the best way to incorporate a Bearer token credential from the Solarwinds credential store in an http monitor using Powershell.
Thanks.