DEV Community

Ahmed Mahmoud
Ahmed Mahmoud

Posted on

Is there a official recommendation for the access token and refresh token life time?

Just a question that I never found an answer to it so far.

Top comments (4)

Collapse
 
byrro profile image
Renato Byrro

What do you mean by "official recommendation"? I'm not aware of any "Token Authority Foundation" setting industry standards... You should consider security, convenience, or any other factors particular to your case.

Is it an internet banking system? I'd set the token to expire in short minutes.

Is it like Facebook that wants to track and know who you are when you visit a page with a "like" widget? Probably would set to expire in months.

Collapse
 
ahmedam55 profile image
Ahmed Mahmoud

That's really helpful. Thank you so much for your time and effort 😊

Collapse
 
sirluis profile image
Luis Henrique

I never found any "official" guideline. People often recommend that access tokens must be short-lived (min. to hours) and refresh tokens can have a larger lifespan (days, weeks...).

Collapse
 
ahmedam55 profile image
Ahmed Mahmoud

Thanks your your time and effort. That's really helpful