Hey guys,
Just a quick one to see if anyone has done this before.
We are looking to integrate with a non-laserfiche service using the web request activity in Workflow to send requests to an internal API endpoint, however the service we are using requires authentication using an access token. The request to the authentication service returns something similar to the following, which then requires us to use the access token as authentication for any subsequent requests.
{ "access_token": <access token> "expires_in": 3600, "refresh_expires_in": 0, "token_type": "Bearer" }
We can get this working by requesting a new access token immediately before any API request we make in workflow (i.e. one request to the authentication service to gain a token, followed by another request to perform the actual API call) but this results in having to request a lot of new access tokens, when theoretically we could use the same token for up to an hour.
My question is - is there a way to refresh the access token automatically in the background somehow and use it across multiple different workflow instances to authenticate requests? Maybe using a cookie or something?
As I said, the way we have it working at the moment does work, but as we build more workflows that use this authentication service it's going to generate a lot of requests to the service, which may have some performance impact for the customer.
Cheers!
Dan