This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Using Bearer token authentication in Solarwinds http script monitor

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.

Parents
  • Note that I am still working on this issue.

    My script monitor works fine with the Bearer token represented in plain text in the script body.  However, I'm still working to obfuscate the credential:

    1. All settings >> credentials >> manage api poller credentials.  Allows me to add a Bearer token credential.  However, these credentials do not show up when I use the Credential drop down in the SAM application template.
    2. SAM settings >> credentials library.  This credential store appears to offer username/password only.  No option for Bearer tokens that I can find.
    3. All settings >> Manage API Pollers.  I'm having no luck with this.  It appears that the API poller applet wants to browse a URL and return a list of objects.  In my case I need to run a PromQL query against an Openshift "Thanos" endpoint and return data.  A simple browse won't help much.

    Any ideas from the community would be much appreciated.  Cheers.

Reply
  • Note that I am still working on this issue.

    My script monitor works fine with the Bearer token represented in plain text in the script body.  However, I'm still working to obfuscate the credential:

    1. All settings >> credentials >> manage api poller credentials.  Allows me to add a Bearer token credential.  However, these credentials do not show up when I use the Credential drop down in the SAM application template.
    2. SAM settings >> credentials library.  This credential store appears to offer username/password only.  No option for Bearer tokens that I can find.
    3. All settings >> Manage API Pollers.  I'm having no luck with this.  It appears that the API poller applet wants to browse a URL and return a list of objects.  In my case I need to run a PromQL query against an Openshift "Thanos" endpoint and return data.  A simple browse won't help much.

    Any ideas from the community would be much appreciated.  Cheers.

Children