user14577547
user14577547

Reputation:

Token based authentication vs JWT or passport laravel?

What's the different if I used a column in users table api_token for token auth, and if I used JWT or passport Laravel ???

My app is an e-commerce contains an API for mobile apps!

Upvotes: 1

Views: 1382

Answers (1)

POONAM KHATRI
POONAM KHATRI

Reputation: 59

Token-based authentication is a protocol which allows users to verify their identity, and in return receive a unique access token. During the life of the token, users then access the website or app that the token has been issued for, rather than having to re-enter credentials each time they go back to the same webpage, app, or any resource protected with that same token.

JWT is aJSON web token (JWT) is an open standard. The finished product allows for safe, secure communication between two parties. Data is verified with a digital signature, and if it's sent via HTTP, encryption keeps the data secure JWT has some limitations like,JWTs rely on a single key. If that key is compromised, the entire system is at risk and you can’t push messages to all clients, and you can’t manage clients from the server side.

Laravel Passport is native OAuth 2 server for Laravel apps. Like Cashier and Scout, you'll bring it into your app with Composer. It uses the League OAuth2 Server package as a dependency but provides a simple, easy-to-learn and easy-to-implement syntax.Passport exposes a JSON API for your frontend to consume to let you manage your clients and tokens. Out of the box, Passport comes with Vue components that show how you might want to interact with this API in your app. You could use these components and call it done, or you could write your own tool to interact with the API. You have to do long working Laravel Passport and it is time consuming and cinfusing.

Token-based authentication is better than JWT annd Laravel passport.

Upvotes: 1

Related Questions