Download the PHP package randomstate/laravel-auth-jwt without Composer
On this page you can find all versions of the php package randomstate/laravel-auth-jwt. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download randomstate/laravel-auth-jwt
More information about randomstate/laravel-auth-jwt
Files in randomstate/laravel-auth-jwt
Package laravel-auth-jwt
Short Description JWT issuing and verification strategy for randomstate/laravel-auth
License MIT
Informations about the package laravel-auth-jwt
randomstate/laravel-auth-jwt
This is a JWT authentication strategy for randomstate/laravel-auth
.
It serves both the issuing and the authentication of JWTs.
Usage
Register with Auth Manager: Follow strategy service provider example here: https://github.com/randomstate/laravel-auth
Configuration
You should configure your token issuer (Issuer::class) so that the appropriate standard claims are made (iat, aud etc) depending on your needs.
Issuing a Token
This package automatically resolves your Issuer::class configuration out of the Laravel container. This means that any tokens issued can be checked without worrying if you have configured everything correctly - as long as you don't change the way laravel binds the Issuer::class between issuing a token and consuming it, you can rely on it being consistent.
Typically you will want to use a specific login route to authenticate a user via username and password. You should simply perform any login logic (usually handled out of the box with Laravel) and then issue and return a JWT token as so:
Authenticating via JWT
You may supply your JWT token as an Authorization: Bearer {token}
header or as a token
request parameter in your request.
This will automatically be pulled out when using the LaravelAuth authenticate middleware and authenticated.