Download the PHP package arrow-web-sol/laravel-jwt-auth without Composer

On this page you can find all versions of the php package arrow-web-sol/laravel-jwt-auth. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-jwt-auth

Laravel JWT Auth

A simple method to authenticate users in Laravel via a JWT - http://jwt.io

A bearer token is taken from the request, this token is then checked using the configured JWT algorithm. If the token is deemed valid, the the request is "authenticated". This package will check to ensure the token was signed using an appropriate key and is valid at the time of the request (iat, nbf and exp claim checks).

A common use case is in authentication in Laravel micro-services. Your auth service (Passport for example) can issue a JWT on successful login. Your other services can then use this package to authenticate requests without touching your auth service. Because a JWT is cryptographicaly signed you can verify the token originated from your auth service and hasn't been tampered with.

Installation

composer require arrow-web-sol/laravel-jwt-auth

Then run

php artisan jwt-auth:publish:config

That creates a jwt-config.php config file, in here you can set the signing method used, hash used, key (hmac only) and the public key (rsa and ecdsa). The key or public key is used to verify the JWT.

NOTE: the jwt-config.php is merged into auth.php as part of the service provider boot process. It adds a guard and provider for 'jwt', which in most cases will never be set nor used. But if you do have a 'jwt' guard and or provider in your auth.php file then be aware this package will override that key.

Middleware

To protect routes, you can now use 'auth:jwt':

Or, to set default auth method, edit config/auth.php

The package needs the token to be sent as a bearer token in the authorization header.

Testing

You can use the normal Laravel test methods:

Although we do this as part of our test suite, you can test the full token flow:


All versions of laravel-jwt-auth with dependencies

PHP Build Version
Package Version
Requires php Version 8.0.*|8.1.*|8.2.*
ramsey/uuid Version ^4.7
lcobucci/jwt Version ^4.3
illuminate/auth Version ^9.0|^10.0|^11.0
illuminate/contracts Version ^9.0|^10.0|^11.0
illuminate/http Version ^9.0|^10.0|^11.0
illuminate/support Version ^9.0|^10.0|^11.0
spatie/laravel-package-tools Version ^1.13
nesbot/carbon Version ^2.64|^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package arrow-web-sol/laravel-jwt-auth contains the following files

Loading the files please wait ....