I have the following query about using EDP to connect to the websocket api from multiple instances of an application.
I realise that we are allowed 5 concurrent mounts per machineID to authenticate, but these must share access tokens rather than actively authentication 5 separate times.
If I refresh a token in a separate running piece of code - is there a rule/invariant about how quickly the old token will expire & my code that is listening to a websocket will fail?
With the current model that requires token sharing rather than concurrent logins - how can I avoid downtime? I'm unsure how this is possible & how other's have solved this problem previously.
I realise the last question is fairly open ended but I'm having trouble coming up with a solid solution.
Thanks in advance for the help.
When you acquire a refresh token from AAA, the response will inform you when you need to refresh your access tokens. This value has been currently set to 300 seconds (5 minutes). To ensure your tokens do not expire, I would suggest you refresh 90% of this time, I.e. 270 seconds.
if you plan on running multiple instances of your application, I would suggest you reach out to your account manager and request for multiple IDs. I don’t think creating a complicated distributed queue of applications where a master within that group is responsible for refreshing tokens and ships them around to other members is required to manage the limitations of the current authentication. There are plans in the future to utilize a alternative authentication mechanism address the current limitation.
In the simple test scripts I was using, I shared the token and the token expiry time with the other instances - so they knew when to fetch the new token from the main instance.
In terms of the expiry time, you can get the expires_in value from the auth response as described in Authorization - All about tokens
TBH - if you discussed the multiple mount scenario with your Account Team when you signed up, I would recommend you discuss the possibility of obtaining multiple machineIDs - to avoid sharing tokens.