Why use a JWT?

In fact, digging in the projects, I noticed that any project that uses Doctrine 2 and DDD, using JWT, and write custom authorization, reinstatement, registration of users.

Why and what for?

For example in Laravel + Doctrine, of course, the standard Auth package and Guard will not work with Doctrine, because those packages on Eloquent.

What about Symfony? I see that JWT used packages where there are no FOSUserBundle, why? Is there or is not provided in standard packages Symfony to develop a system of authorization of users?

Example package:
https://github.com/lexik/LexikJWTAuthenticationBundle
June 10th 19 at 16:38
1 answer
June 10th 19 at 16:40
Solution
And what you do not like the JWT? This method of preserving and transmitting the status, in particular authentication data, more versatile than a standard entry in the session.
I wrote in the question. Why can't I use Symfony standard features? Why put additional plugins, dependencies, and cut your own? The versatility? It's worth it? - jaycee commented on June 10th 19 at 16:43
If one server, you can session, if you expect that there may be several servers (not replicas, but let's say the backend and the communication messenger), you have to think about artificaly. And JWT will help you with this, maybe this is standard. But it's not the most reliable technology, a lot of problems with the reliability of the token, and the complexity of revalidatie. And so it is suitable technology. You can still apply for many fronts (on different domains), or applications for mobile. But in General, if a web application server rending, that session the most. - alfonzo.Funk9 commented on June 10th 19 at 16:46
If say, I want to make application for your web service through the API on Android. It is better to choose? - jaycee commented on June 10th 19 at 16:49
here a greater contribution to the solution gives the answer to the question - what is architecture in the service. Monolit - well you can, and during the sessions. Although you can provide api always better as possible stateless. Token it better. - Shirley.Wunsch commented on June 10th 19 at 16:52
In the sense of "monolith"? - jaycee commented on June 10th 19 at 16:55

Find more questions by tags SymfonyJSON Web Token