Auth0 Home Blog Docs

Refreshing token with short expire time on a SPA

jwt
spa
refresh-tokens
vuejs
tier1

#1

I am working on a SPA project where i would like to have very short expiration (15min) and ability to refresh these. I will be utilizing VueJS so it would be beneficial to do the refreshing behind the scenes. Since it is a SPA i cannot use refresh_tokens. Whats my options in this case?


#2

You can try with implicit flow, and then renewAuth using auth0’s web sdk. This will renew your token on an iframe and works without using a refresh token. The drawback is that you need to use a login page hosted on auth0 and since this will require a redirect it will not be so nice for a SPA.


#3

I took basis in https://auth0.com/blog/vuejs2-authentication-tutorial/ but unfortunately it also redirects to the lock10 which is not a super nice solution…


#4

@maziar did you find a solution to this? I have SPA too, and I don’t want to redirect anywhere.


#5

@maziar did you find a solution to this? I have SPA too, and I don’t want to redirect anywhere.


#6