architecture - JWT Authentication and user validation -
i'm not sure understand concepts of how proper jwt authentication must work. have found article jwt authentication author talks that:
..the token self-contained, client need resend server each request, , server have check signature ensure validity. no more useless call database or ldap. i'm little bit concerned phrase- no more useless call database or ldap
but how check example user still exists in system or user has not been banned , token has been expired ?
looks need make call database or ldap in order information , compare info inside of jwt token. isn't ?
you correct if must check on every call, need query database or call authorization server.
but point jwt tokens should have short enough lifetime should not have worry this.
if token expires every hour, , user deleted or banned, he/she have access apis @ hour (or whatever token lifetime is). client needs renew token , figures out user no longer valid.
not having query database or call service each token validation make service scale better. removes single point of failure (auth db or service down).
Comments
Post a Comment