🔑 JWT Authorization | Angular Router Guards | Token Refresh
Video Statistics and Information
Channel: Dev Academy
Views: 133,347
Rating: 4.8681111 out of 5
Keywords: jwt, jwt node, authorization json web token, jwt auth, angular jwt, angular login authentication, angular security login, angular login, jwt refresh token, jwt refresh, angular 7 login page example, passport jwt, express passport jwt, router guard, router guard angular, http interceptor angular, jwt angular, json web token, how to implement angular login, how to implement login page in angular, how to refresh jwt token, how jwt token works
Id: F1GUjHPpCLA
Channel Id: undefined
Length: 23min 27sec (1407 seconds)
Published: Fri Dec 14 2018
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.
I’ve seen JWT advertised as a solution for stateless servers/services. But when you keep a list of JWTs for invalidation (so the user could logout) it’s no longer stateless. If your server is composed from micro-services or your server is behind a load balancer, you’d probably put your list of valid JWTs in a redis store - so now you need a database with JWTs.
There are benefits of course, especially when your server is composed of stateless services, but I don’t see why you’d need to use JWTs on the frontend side.
I would recommend having an api gateway service which uses cookies when communicating with the frontend, but when the session is valid, would use JWTs when communicating with the backend services.
Something like this (from google image search): https://cdn-images-1.medium.com/max/1200/1*gVkz7gEGrXwD7nxeT1o0nA.png
Sources:
Angular: https://github.com/bartosz-io/jwt-auth-angular
Node: https://github.com/bartosz-io/jwt-auth-node