mrellipse / toucan

Boilerplate template using Vue.js, TypeScript and .NET Core 2.1, based on SOLID design principles
MIT License
212 stars 36 forks source link

Sliding expiration #22

Closed smanaton closed 6 years ago

smanaton commented 6 years ago

Hi,

I would like to be able to use sliding expiration, the current token lasts for 5 minutes but i would like to be able to refresh the token everytime a authenticated request is made so to get a rolling 5 minutes, i'm new to vue and aspnetcore but i have worked with .net framework for many years, is this something that can be done easily?

Thanks

Shane

mrellipse commented 6 years ago

gday! it shouldn't be too much hassle - but it does touch just about every layer in the app.

the gist of it would be

mrellipse commented 6 years ago

just as an FYI, this stack overflow article JWT token refresh (sliding sessions) and signout is a nice resource

i like the idea of only letting the refresh event occur a max # of times per period - just to restrict the overall time a compromised user token can be used if hijacking occurs!

smanaton commented 6 years ago

Thanks for this, i will give it a go.

mrellipse commented 6 years ago

good luck, and please let me know how it goes!

hmuhdkamran commented 6 years ago

This may help you, https://github.com/jacobslusser/JwtAuthRenewWebApi/blob/master/docs/Sliding-Expiration.md

mrellipse commented 6 years ago

stale issue. closing for now.