I am making a webservice API call from the webservicebeforeoperation rule. I am using the authentication header from the requestEndPoint as below to set in my HttpURLConnection
But if the accesstoken is expired the connector do not regenerate a new token when it executes the before operation rule, and I am getting a token expired error in my rule.
Have anyone faced this issue ? Is there a way to force a connector re-authentication from the webservice before operation rule ?
If your token has an expiration time, you have to make an additional API call to refresh it before you use it. If you’re dealing with a source that supports OAuth 2.0 and can do a token refresh, you can follow the documentation here to set it up: OAuth 2.0 Authentication
If you can’t use OAuth 2.0, you can manually make that refresh token API call from the before operation rule and use the put() method on the header object from your example above to set the value of the token you acquired from the response manually. Finally just do a requestEndPoint.setHeader(header) to update the request object with the new token.
Once I started re-generating the token in the rule the main provisioning gave me a credential error. That could also be addressed by setting the new credential back on the application via