GitHub user dmainou edited a comment on the discussion: Hop Mail Action with 
OAuth Authentication

I just implemented an OAuth yesterday.  The token is good for 30 days and the 
provider does not want me to refresh the token until it's about to expire. 

Here is what id did. 

- Hpl checks the age of the token if expired or doesn't exist.
If ok then logs the token and terminates. 
Else it triggers next hpl (create/ refresh)
- HPL checks token age.
 If no token uses client ID, project ID, user name and password to get initial 
token and refresh token.  Else uses client ID and project ID and refresh token 
to obtain a new token. 
Once we have the token we calculate the expiry (+x seconds) subtract a margin 
of safety (1d) to allow an evergreen refresh. 
Outputs token to SQLite or a key store. 

Token is retrieved from sqlite/ store as needed throughout the solution. 

If your token has a shorter expiry you can set the relevant fields as JVM 
variables and not have a DB or extra service in the middle. 

GitHub link: 
https://github.com/apache/hop/discussions/5645#discussioncomment-14226653

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to