OAuth 2.0 refresh token

tomeczek1
Tera Contributor

Hi all developers,

I working on a new integration with 3rd party application. The authentication is done via Okta where I get the token. The token is valid for 1 h.  I created a custom action with REST step in Flow Designer. This action is getting a list of the application using the token in the header as [Authentication = Bearer {token}]. The problem is with the refreshing token. Every hour I need to refresh the token manually. The goal is to refresh the token every hour or check if the token expires.  I created a new application registry with Configure an OIDC provider to verify ID tokens. This application profile is used in the alias but not working as expected. Can you please advice me on how to handle this type of authentication?  

 

2 REPLIES 2

reachphani1
Tera Contributor

oAuth tokens are stored in oauth_credential table. Look up this table for your provider based on peer.name column for expiry and request a new token if not found. You can do this from your custom action.

GB14
Kilo Patron

@tomeczek1 How did you achieve this? Were you able to refresh the tokens every hour? 

THanks