Save token after authentication to a remote REST API

I’m working on a check/agent to gather data from a REST API (Extreme XIQ to get Access Points).

Currently we auth using username password and then we get a token that is valid for a period of time. It will generate a new token every time the agent run.

Is there a way to “save” or cache the token and reuse it until expiration ?

Your special agent can use any directory below $OMD_ROOT/var or $OMD_ROOT/tmp.

1 Like

As example you can use the vSphere special agent or my Redfish agent.
Booth save the session cookie to file for further usage.

2 Likes

Thanks guys !

For reference, I based my solution on Check_MK-Things/check plugins 2.2/redfish/agents/special/agent_redfish at master · Yogibaer75/Check_MK-Things (github.com)