Forum Discussion

Tim_OShea's avatar
Tim_OShea
Icon for Neophyte rankNeophyte
10 months ago
Solved

Multi Step website test with variable

We have a website test on a site that uses session based tokens, whcih are passed by the authentication process.

I can curl the website and get a token, and then paste the token as a bearer token in another curl, but can’t figure out:-

  1. how to do this with a website test
    or
  2. how to build a new datasource to do this.

The token expires after 15 minutes, so setting up as a persistant value in the headers for the webtest doesnt work.

Can anyone help?

13 Replies

  • Hi,

    Sorry if I am asking a dumb question, but where would I find the video?

    I am more of a sysadmin than a developer, so have limited coding and need a bit of a dummies guide.


     

  • There’s a video the LM training team has that shows how to do it. @Victoria Verhulst made it a long time ago, but it’s still valid.

  • Hey @Tim OShea 

    So, this can be accomplished using an internal web check in your portal.  It will require the use of groovy coding to accomplish so you can pull that token and then pass it to the next step in the check. 

    This doc does go over that process:

    https://www.logicmonitor.com/support/services/adding-managing-services/executing-internal-web-checks-via-groovy-scripts 

    I would also recommend reaching out to the LogicMonitor support team should you have any questions as although we cannot craft those custom scripts for you, we have dealt with this quite a bit and will likely be able to get you up an running!