What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Access to Bearer Token stored in device from EXE/Script Advanced

Votes:

0

I use a EXE/Script Advanced PowerShell script to periodically get a new OAuth2 access token for an API service. I store this token in a device with setobjectproperty, in the Bearer Token field (identified with the name paessler-rest-authentication_section-authentication_group-bearer_token).

This works, and I refer to this token from REST Custom v2 (BETA) sensors. However, I also need to lookup this token from another EXE/Script Advanced script and try to use getobjectproperty on the device to get the token, but I only get a censored value like this:

<?xml version="1.0" encoding="UTF-8" ?>
<prtg>
<version>22.4.81.1532+</version>
<result>***</result>
</prtg>

How can I get the actual token?

bearer-token exe-script-advanced powershell

Created on Jan 26, 2023 9:08:19 AM

Last change on Jan 30, 2023 5:29:59 AM by  Felix Wiesneth [Paessler Support]



1 Reply

Votes:

0

Hello,

this is a security measure and sadly not designed to be circumvented.
In this case I would recommend to get a fresh BearerToken from inside this script.


Kind regards, Johannes Beyerlein, Technical Support Team

Created on Feb 2, 2023 3:47:13 PM by  Johannes Beyerlein [Paessler Support]




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.