jwt-auth provides a simple means of authentication within Laravel using JSON Web Tokens (spec). There are several ways to create a token within the package. There are simple ways to do it, and more advanced methods if you want greater control. The most common way to create a token would be to authenticate the user via their login credentials, and if successful return a token corresponding to that user. You can also skip user authentication and just pass in a User object. Once a user has logged in with their credentials, then the next step would be to make a subsequent request, with the token, to retrieve the users' details, so you can show them as being logged in. To make authenticated requests via http using the built in methods, you will need to set an authorization header. If you don't like the idea of catching mulitple exceptions inline, then you are free to add a global exception handler with Laravel.

Features

  • Attempt to authenticate a user via some credentials
  • Log a user in and return a jwt for them
  • Log the user out, which will invalidate the current token and unset the authenticated user
  • Get the currently authenticated user or throw an exception
  • Refresh a token, which invalidates the current one
  • Get a token based on a given user's id

Project Samples

Project Activity

See All Activity >

Categories

Authentication

License

MIT License

Follow jwt-auth

jwt-auth Web Site

Other Useful Business Software
Enterprise-grade ITSM, for every business Icon
Enterprise-grade ITSM, for every business

Give your IT, operations, and business teams the ability to deliver exceptional services—without the complexity.

Freshservice is an intuitive, AI-powered platform that helps IT, operations, and business teams deliver exceptional service without the usual complexity. Automate repetitive tasks, resolve issues faster, and provide seamless support across the organization. From managing incidents and assets to driving smarter decisions, Freshservice makes it easy to stay efficient and scale with confidence.
Try it Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of jwt-auth!

Additional Project Details

Programming Language

PHP

Related Categories

PHP Authentication Software

Registered

2021-06-09