Maayans
Maayans

Reputation: 133

Laravel default auth vs Token authentication

I start building a new app and wonder what will be the best way to implement auth - security wise.

What are the cons, pros, and differences between the Laravel make:auth and using jwt-auth.

Is Laravel's default auth will be enough?

Upvotes: 0

Views: 309

Answers (1)

Mesuti
Mesuti

Reputation: 908

This description is pragmatic approach so you can do something else if you want.

I think while developing an API you should use JWT based authentication mechanism.

The Json Web Token(JWT) tokens includes user information in itself. So it giving so much important benefit to manage session. First and most important of the benefits is you can be manage sessions without storing them at server. I would like to explaint it just to avoid misunderstanding, you can have store it at server but it's not necessary except a few scenario. These scenarios depend on how you could designed your authentication.

I able to do a lot of more explains about of it but in summary if you are developing an API I propose you would use JWT-Token.

Upvotes: 1

Related Questions