R
R
Romi2021-08-22 12:37:06
User identification
Romi, 2021-08-22 12:37:06

When should I choose Laravel Passport over JWT or Sanctum?

The same is true for JWT :)

The essence of the matter is that Sanctum is quite efficient for stateless authentication, and is quite simple.

However, as far as I can tell, the majority opt for JWT, and some opt for Passport.

What's in the salt? Surely this complication has some rational basis?

But which one?

Thanks in advance for a clear answer (preferably based on personal experience).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Tolmachev, 2021-08-22
@dark_tke

In short:
Sanctum is an extremely simple authorization mechanism for PWA applications. I set the format and it works. If you don’t need any subtle settings at all, it’s a working option, but only if you are the only one working with your api, and if you only have a PWA application and custom settings, you basically don’t need
JWT - in fact, technology and any custom solution where there's not much out of the box. There is a foundation, and then whatever. Because JWT is a technology, not a package.
Passport is a complete framework for OAuth server. Ideal for situations with shared access, and if your API will be used by third-party developers.
Well, if very briefly. Different tools for different tasks.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question