Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
StuartIsaac
Contributor
Contributor

OAuth 2.o

Hi,

We've set up a test in Postman for OAuth 2.0 which requests the access token the token we are issues is only valid for 60minutes, so, my question is how do we set token request in Talend Studio?

Thanks,

Stuart

Labels (3)
1 Reply
Prakhar1
Creator III
Creator III

Hello,

So your main concern is how to get new token after 60 minutes.

if yes, then we are also using some same scenario where we follow below steps.

 

1) Get the access token.

2) After that In the job there is part implemented where the validity of the token is checked. There is a variable created (ex. tokenPeriod ) and value of current timestamp + 23 minutes is assigned to it.  (using tJavaFlex )

conext.tokenPeriod = Talend.addDate(Talend.getCurrentDate(),23,"mm"));

3) Later in the workflow before next API call will be made - it is checked whether the 23 minutes have already passed. If yes the same process as described above is executed. The check is performed by comparing the variable (tokenPeriod) and the current timestamp.

 

Hope this helps.