GitHub user dmainou added a comment to 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 age if token if expired or doesn't exist.
If ok then logs the on and terminated. 
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 poirier id and refresh token 
to obtain new token. 
Once we have the token we calculate the expiry (+x seconds) substract a margin 
of safety (1d) to allow an ever green refresh. 
Outputs token to sqlite or a key store. 

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

If your token has 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 users@hop.apache.org.
To unsubscribe, please send an email to: users-unsubscr...@hop.apache.org

Reply via email to