DEV Community

loading...

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

ahmedam55 profile image Ahmed Mahmoud ・1 min read

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

Discussion

pic
Editor guide
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 Author

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 Author

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