lexik / LexikJWTAuthenticationBundle

JWT authentication for your Symfony API
MIT License
2.53k stars 610 forks source link

How to use LexikJWTAuthenticationBundle as identity provider in many projects? #1048

Open DebasishDev2021 opened 2 years ago

DebasishDev2021 commented 2 years ago

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?

fd6130 commented 2 years ago

I think this is quite hard to tell since you have to use Symfony User together with this bundle to make it works.

If you simply just want to use JWT without Symfony User you can find and use a library that generate a JWT.

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

Public and Private key.

Typically, a private key, or secret, is used by the issuer to sign the JWT. The receiver of the JWT will verify the signature to ensure that the token hasn’t been altered after it was signed by the issuer.