How to use LexikJWTAuthenticationBundle as identity provider in many projects?

176 Views Asked by At

I am planning a new microservice project. Single microservices are REST-APIs, the user should authenticate himself with JWT. I want to use the LexikJWTAuthenticationBundle for implementing JWT.

How can I make sure that the token is validated correctly on different servers?

1

There are 1 best solutions below

0
Rob Conklin On BEST ANSWER

Don't do distributed authentication, make one server be the auth server which the other servers send the token to for authentication. You can cache the authentication for a (short) period of time, but the data-of-record for the JWT token should be centralized so that if it is invalidated it is invalidated everywhere.