jwt-authentication's People
Forkers
nanerwoori baprivas irtyamine kaanuki gshimabukuro trivedisorabh useresd avomakesart adamqkc juniormena marinov98 pabloarranz jjiro koketso17 hieung1707 john-sangpi mciekurs2 leeys0716 dopaminedriven nirikshan carlosconnected nivjain jamj2000 pratikmahulkar jocelyn10 chaitu215 aiffin stephensmitchell-forks nursh bbaale15 caketi aamitabhforks dsavai lr193 joskid nadernmds pjithin512 mohammadalaaaldein mahirchavda karnawis maheshruparel pelatge creatigent generic-matrix acolasso yansonggu a2ko johnzenith nikkhil31 bhnybrohn vbmars sverissimo wolfwithcode siam397 musabmahmoodh namanmanish abhi-repos matthewkolmorgen edib littleflute joshua-salvador uxpkumar josesco5 vidyasagar58 harshv9988 harihara6 sharmajays alex700 betoflow ahsan22444555 developer-geekay stevehoober254 prakharsharma41 web-dev-ritchie eduardo76 paurush11 abhiraizada jellemdekker itsalitahir700 abhinav-sureka maxn2developer anandbabup ehvenga-v2 roykaran492 tonyw16 mahmoudmuhammedali birdup000 nofiden gopigaurav karen-n7 saavedraandrei hoseinmirian marloseno marshall0410 pvtyagi7 alamincse07 abhishekram404 lum1616 djneces akhlxdjwt-authentication's Issues
Should refresh token have expiration time ?
Hey Kyle, I have followed your tutorial on YouTube and also implemented some logic like you using JWT but in Java with the Framework Spring-Boot.
I am working on a mobile app like Twitter and I would like to know if refresh-tokens should have an expiration time or are there valid forever ?
Question
Hey Kyle.
I've came across your tutorial whilst researching for JWT Authentication.
Quite useful. I'm implementing a prototype myself for a project and I'm a bit confused still.
Lets assume I have a website (example.com) which handles my front-end code. It is a React application that relies on another website for an API (lets say some-api.com)
I've managed to:
- Create a GraphQL Database of Users and Tokens (not in your tutorial)
- I've created the
/register
route and the/login
route, both working fine, and withe the later returning the accessToken and the refreshToken - I've also implemented the
/token
route to remove the old token from GraphQL list of valid tokens, and I have it generating a new accessToken and refreshToken similar to what I done in the/login
I Guess my questions are two.
- When should I use the accessToken vs the refreshToken
- How can I validate a "secure" react router "route" somewhere on my website (example.com)
Do I need to create a new method that checks if the current accessToken is valid? or should I be checking against the refreshToken? That's what's making it confusing for me.
accessToken's are meant to expire quickly right? So should I be using the accessToken to every api request I need (like /user-profile
or whatever) or should I pass the refreshToken?
Thanks for the insight.
Kind regards
Andre
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.