Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
FShaik
Contributor
Contributor

How to implement Refresh Token for API authorization to handle session expiration

Hi Team,

We are calling API through rest client using bearer token, which gets expired after 1 hour but as per my requirement the session should not be ended even after 60 min.

For that I am trying to implement refresh token which will generate new bearer token so that the connection will be intact.

Whenever we call the API using username and password, we get refresh token along with access token, but unable to implement refresh token in my job.

Can anyone please help me on this.

Thanks

Labels (3)
3 Replies
Anonymous
Not applicable

Hi

I processed the same requirement before, normally, there should be an API that is used to retrieve the refresh token, and use the new token for another API calling in the same job. Why you can't get refresh token in the job? How you get the refresh token when it is expired?

 

Regards

Shong

FShaik
Contributor
Contributor
Author

Hi Shong

 

Thanks for the reply.

 

In our job, firstly we are generating access token. Using this access token, we are calling another API. The response we will be getting from second API takes more than 1hr, so our job is getting failed due to token expiry.

 

We need to have an approach where in the job should not fail due to token expiry and at the same time we need to fetch all responses from API as well.

 

Thanks

 

Anonymous
Not applicable

I think we can do nothing to prevent the job fails due to token expiry in one call,

is it possible to add some parameters to API to reduce the data volume so that the API calling will end less than an hour, and call the API one more time within an hour.