on 2023 Sep 21 11:19 PM
How can I implement a token refresh mechanism in my CPI integration that queries information in the SFSF PerPerson entity and sends it to a third party web service, given that the communication token with the third party service has a lifetime of only 2 hours and do the integration runs take longer than that time? Any suggestions or ideas whether it be a groovy script or some conditional or something to implement a timer that refreshes the token before it expires in this scenario?
Request clarification before answering.
If your iflow is running a loop and kept calling the 3rd party service, and that process goes over 2hrs, then your iflow should implement a tokenValidity check sub process to see if the token you currently have still valid and if not fetch a new one. However to do this you have to totally shift your auth credentials from OAuth security artifact to your iflow itself. You could store client-id and secret as security artifiact though. Usually token fetch service tells you how long the token is valid. Based on that timestamp and current timestamp, you have to chekc for the validity period everytime you are going to make a call to the target service and fetch a new token if needed, probably 5 minutes ahead of time.
I am not sure but OpenConnectors does the token refresh automatically as far as I know. Never tested though. If you use OC as connection mechanism you might be covered.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Andres,
Please create separate iflow that performs Token Fetch, Token Validation check and call this from your iflow using process direct.
Have your iflow designed in such a way ( after certain steps are completed ) you will be validating these tokens are valid or not so that you can proactively take care of issues related to Token Expiry.
You can cant just calculate exact 2 hours completed or not and then only fetch new token. Instead of that add proactive measure like above to make sure token Expiry failure willnot occur in you iflows.
Regards,
Sri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
66 | |
9 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.