How to handle Access token


#1

@jen.looper :
I am using identity server3 for Authenticate my user. Identity server provides me the access token and refreshtoken after successful logged in.
Access_Token : Access token valid only for 1 hour.
Refresh_token : this token is used when access_token is expired and Wants new access_token from Identity server3

Application Starts and logged in works fine… but I am not able to handle access_token when it’s expired.

Problem:
User logged in application use application and close it… once again it open application he/she does get any new updates while access_token is expired.

I don’t have much idea how can I handle this situation When application starts at that time check whether access_token is not valid that use this refresh_token to get new access_token from Identity server3

Thanks in advance


#2

What if you ran every call through a helper which validates token access, if expired, then navigates the user back to login or issues the refresh before it’s officially called?

Is that the problem?


#3

@sitefinitysteve: thanks for the reply but I don’t know how to handle it… requirement is that… we user reopen or remains using the application and Access_token should be refresh in the background…
it means that whenever user reopen the application first check the access_token is expired or not…if Expired than call API for getting new access_token afterwards redirect to main screen…

How can I implement this on Ng2 project. ?

Could you please help me on this… ?