cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dynatrace Synthetic Monitoring credentials using PAM api

jordan_rose
Helper

Is there any way for Synthetic Monitoring transactions to call the CA PAM api to get a user account/credentials?

 

Our security team is pushing for a "check in/check out" process for certain service accounts. If we could call the PAM api to get the account and credentials this would satisfy that need.

 

4 REPLIES 4

Philipp_Kastner
Dynatrace Pro
Dynatrace Pro

Hi @jordan_rose,

 

are you using browser monitors? If yes, you can use a JavaScript event to execute simple API calls.
Similar to the example shown in the help

Philipp_Kastner_0-1616101294887.png

Hope this helps,

Philipp

jordan_rose
Helper

Hi Philipp, thanks for the reply and this is very helpful. Once I retrieve a user name how can I set it to a variable and input that into a form field. I looked through the doc and didn't see this and I haven't had any need to edit the scripts of the recorded click path yet so forgive me if I'm missing it. 

 

Any help on this much appreciated!

You have two options.

1. You can store the user name via api.setValue and use it in a subsequent keystroke events via placeholders for example {username}.

2. You set the value of the input directly via JavaScript.

 

Example

 

api.startAsyncSyntheticEvent();
fetch('https://randomuser.me/api/').then((resp) => resp.json()).then(function(data) {

    // Option 1 - Store username via api.setValue to use in subsequent events
    api.setValue("username", data.results[0].name.first);

    // Option 2 - Set input value directly via JavaScript
    document.getElementById('username').value = data.results[0].name.first;

    api.finish();
}).catch(function(error) {
    api.fail('Fetch request to randomuser.me failed');
});

 

Using the placeholder in a subsequent keystroke event

Philipp_Kastner_0-1616397056637.png

Kind regards,

Philipp

Phillip, this is awesome, Thank you so much for replying with this info. I will do some testing to try to get this working....

 

 

Featured Posts