🔐 JSON Web Token Authentication for Laravel & Lumen

Overview

jwt-auth-banner

PHPUnit Codecov branch StyleCI Latest Version Latest Dev Version Monthly Downloads

Documentation

Documentation for 1.* here

For version 0.5.* See the WIKI for documentation.


Supported by Auth0

If you want to easily add secure authentication to Laravel apps, feel free to check out Auth0's SDK and free plan at auth0.com/developers

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

License

The MIT License (MIT)

SensioLabs Insight

Comments
  • Refresh token

    Refresh token

    I use refresh token middleware

    Route::group(['prefix' => env('API_VERSION', 'dev'),'middleware' => ['jwt.refresh','jwt.auth','user.lastseen']], function()

    I always get token invalid message (token_invalid)?

    thanks:D

    opened by marijang 53
  • Laravel 5.5. jwt:generate issue

    Laravel 5.5. jwt:generate issue

    Hi all, I came upon one issue when I try to run php artisan jwt:generate I get the Reflection Exception saying "[ReflectionException] Method Tymon\JWTAuth\Commands\JWTGenerateCommand::handle() does not exist"

    Both Facades and service providers are entered properly and they are valid.

    Also for people who have a struggle to make it work I can advise one solution. Go to JWTGenerateCommand.php file located in vendor/tymon/src/Commands and paste this part of code public function handle() { $this->fire(); }

    I know this is not an elegant solution, but it works. I hope this might help until official fix arrive.

    Have a nice day.

    opened by Milos0110 49
  • Add support & documentation for integrating with Lumen 5.2

    Add support & documentation for integrating with Lumen 5.2

    Since Lumen does not support session state, incoming requests that we wish to authenticate must be authenticated via a stateless mechanism such as API tokens. This package is really going to be helpful for resolving out the authenticated user from the request through API token. https://lumen.laravel.com/docs/5.2/authentication

    Auth::viaRequest('api', function ($request) {
        try {
            if (! $user = JWTAuth::parseToken()->authenticate()) {
                return null;
            }
        } catch (Exception $e) {
            return null;
        } 
        return $user;
    });
    

    It would be really helpful if we have another section in the wiki about integrating this package with Lumen. I see that most of the work has already been done ( already there is a LumenServiceProvider ), only that it needs to be upgraded to support v5.2 and documented. Thank you Symon for giving us this wonderful package that we can use with out Laravel and Lumen projects.

    opened by rajabishek 49
  • Token Not Provided

    Token Not Provided

    Hello.

    I've added the following header to all of my requests in Angular:

    Authorization: Bearer eyJhbGciOiJI...
    

    and I can see that it's working. On the Laravel side I'm using:

    public function __construct()
    {
        $this->middleware('jwt.auth');
    }
    

    No matter what I do I'm getting 400 bad request, token_not_provided. Any idea what might be going on?

    Thank you for your work on this package. Matt

    opened by mcblum 48
  • Feature: Laravel 5.2 Custom Authentication Guard and Driver

    Feature: Laravel 5.2 Custom Authentication Guard and Driver

    The docs indicate it is possible to create your own implementation of Illuminate\Contracts\Auth\Guard and registering it as a driver in a service provider.

    I was reading about the new stateless token authentication that was added in 5.2 in a JacobBennett Gist (the docs are really vague), but it doesn't appear to be the same as JWT tokens. That said it would be amazing to be able to leverage Laravel's API the same way.

    Would it be possible to create a custom driver to reduce the amount of changes required to implement JWT tokens, and reduce the API a bit so using more of Laravel's API? For example getting a user is Auth::guard('api')->user(); using the API guard, and the equivalent could be Auth::guard('jwt')->user();

    opened by mtpultz 44
  • How do you refresh Token ?

    How do you refresh Token ?

    Hi

    Is there any documentation on how to refresh token after it gets expired ?

    Also there is conflict if you use both refresh and blacklist for all protected routes.

    opened by mrgodhani 31
  •  Argument 3 passed to Lcobucci\JWT\Signer\Hmac::doVerify() must be an instance of Lcobucci\JWT\Signer\Key, null given

    Argument 3 passed to Lcobucci\JWT\Signer\Hmac::doVerify() must be an instance of Lcobucci\JWT\Signer\Key, null given

    Subject of the issue

    Describe your issue here.

    Your environment

    | Q | A | ----------------- | --- | Bug? | no | New Feature? | no | Framework | Laravel | Framework version | 5.7 | Package version | 11.0.0-rc.3 | PHP version | 7.x.y

    Steps to reproduce

    Tell us how to reproduce this issue. After Pushing code to live server and generating jwt key and clearing config cache. I get Argument 3 passed to Lcobucci\JWT\Signer\Hmac::doVerify() must be an instance of Lcobucci\JWT\Signer\Key, null given, error

    Expected behaviour

    Tell us what should happen

    Actual behaviour

    Tell us what happens instead

    opened by sulemankhann 29
  • Guide for setting up with Lumen?

    Guide for setting up with Lumen?

    Where's the current guide to setting up a recent version of jwt-auth (I'm trying to use 1.0.0-beta.3) with a recent version of Lumen (5.4)?

    I've looked through various threads in the issue tracker (such as https://github.com/tymondesigns/jwt-auth/issues/376) and it's really not clear what the best practice is.

    opened by tremby 29
  • Tymon\JWTAuth\Exceptions\JWTException: Could not create token: Implicit conversion of keys from strings is deprecated. Please use InMemory or LocalFileReference classes.

    Tymon\JWTAuth\Exceptions\JWTException: Could not create token: Implicit conversion of keys from strings is deprecated. Please use InMemory or LocalFileReference classes.

    Subject of the issue

    "lcobucci/jwt": "3.4.0"

    https://github.com/lcobucci/jwt/releases/tag/3.4.0

    ⚠ This version also triggers E_USER_DEPRECATED errors in scenarios where we can't simply use @deprecated. Please make sure you follow the provided instructions before upgrading your production code.

    Your environment

    | Q | A | ----------------- | --- | Bug? | yes | New Feature? | no | Framework | Laravel | Framework version | 8.x.y | Package version | 1.x.y | PHP version | 7.x.y

    opened by jxlwqq 27
  • JWT Auth doesn't have Laravel 6 Compatibility

    JWT Auth doesn't have Laravel 6 Compatibility

    I install a fresh Laravel 6 project. but when I install tymondesigns/jwt-auth package composer require tymon/jwt-auth or composer require tymon/jwt-auth:dev-develop

    but it shows an error

    Problem 1
        - Installation request for tymon/jwt-auth dev-develop -> satisfiable by tymon/jwt-auth[dev-develop].
        - Conclusion: remove laravel/framework v6.0.0
        - Conclusion: don't install laravel/framework v6.0.0
        - tymon/jwt-auth dev-develop requires illuminate/http ^5.1 -> satisfiable by illuminate/http[5.1.x-dev, 5.2.x-dev, 5.3.x-dev, 5.4.x-dev, 5.5.x-dev, 5.6.x-dev, 5.7.17, 5.7.18,5.7.19, 5.7.x-dev, 5.8.x-dev, v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41, v5.1.6, v5.1.8, v5.2.0, v5.2.19, v5.2.21, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.31, v5.2.32, v5.2.37, v5.2.43, v5.2.45, v5.2.6, v5.2.7, v5.3.0, v5.3.16, v5.3.23, v5.3.4, v5.4.0, v5.4.13, v5.4.17, v5.4.19, v5.4.27, v5.4.36, v5.4.9, v5.5.0, v5.5.16, v5.5.17, v5.5.2, v5.5.28, v5.5.33, v5.5.34, v5.5.35, v5.5.36, v5.5.37, v5.5.39, v5.5.40, v5.5.41, v5.5.43, v5.5.44, v5.6.0, v5.6.1, v5.6.10, v5.6.11,v5.6.12, v5.6.13, v5.6.14, v5.6.15, v5.6.16, v5.6.17, v5.6.19, v5.6.2, v5.6.20, v5.6.21, v5.6.22, v5.6.23, v5.6.24, v5.6.25, v5.6.26, v5.6.27, v5.6.28, v5.6.29, v5.6.3, v5.6.30, v5.6.31, v5.6.32, v5.6.33, v5.6.34, v5.6.35, v5.6.36, v5.6.37, v5.6.38, v5.6.39, v5.6.4, v5.6.5, v5.6.6, v5.6.7, v5.6.8, v5.6.9, v5.7.0, v5.7.1, v5.7.10, v5.7.11, v5.7.15, v5.7.2,v5.7.20, v5.7.21, v5.7.22, v5.7.23, v5.7.26, v5.7.27, v5.7.28, v5.7.3, v5.7.4, v5.7.5, v5.7.6, v5.7.7, v5.7.8, v5.7.9, v5.8.0, v5.8.11, v5.8.12, v5.8.14, v5.8.15, v5.8.17, v5.8.18, v5.8.19, v5.8.2, v5.8.20, v5.8.22, v5.8.24, v5.8.27, v5.8.28, v5.8.29, v5.8.3, v5.8.30, v5.8.31, v5.8.32, v5.8.33, v5.8.34, v5.8.35, v5.8.4, v5.8.8, v5.8.9].
        - don't install illuminate/http 5.1.x-dev|don't install laravel/framework v6.0.0
        - don't install illuminate/http 5.2.x-dev|don't install laravel/framework v6.0.0
        - don't install illuminate/http 5.3.x-dev|don't install laravel/framework v6.0.0
        - don't install illuminate/http 5.4.x-dev|don't install laravel/framework v6.0.0
        - don't install illuminate/http 5.5.x-dev|don't install laravel/framework v6.0.0
        - don't install illuminate/http 5.6.x-dev|don't install laravel/framework v6.0.0
        - don't install illuminate/http 5.7.17|don't install laravel/framework v6.0.0
        - don't install illuminate/http 5.7.18|don't install laravel/framework v6.0.0
        - don't install illuminate/http 5.7.19|don't install laravel/framework v6.0.0
        ........................
    

    how to resolve this?

    opened by kennethtomagan 26
  • Proper installation instructions for Laravel 5.7

    Proper installation instructions for Laravel 5.7

    Proper installation instructions for Laravel 5.7

    Really, need a proper walk-through of installation

    Your environment

    | Q | A | ----------------- | --- | Bug? | no / yes | New Feature? | no / yes | Framework | Laravel | Framework version | 5.7 | Package version | 1.0.0-rc.3 | PHP version | 7.1

    Steps to reproduce

    Had to follow 3 different bug reports to get things working.

    Expected behaviour

    I should be able to follow one single version of the truth for the combination I am installing it for.

    Actual behaviour

    Had to fiddle around with things for 2 hours to get them to work... 👎

    opened by vsecades 26
  • A refresh token is used only once

    A refresh token is used only once

    How to refresh token again on a refresh token

    Suppose my token TTL is 1 day & refresh token TTL is 2 days.

    Now the case is what i generate token on 1st day it is working absolutely fine on 1st day. Now 2nd day the token is expired and we generate a refresh token and that refresh token also works perfectly fine. Now on the 3rd day refresh token is expired and we are trying to generate refresh token again on the 2nd day refresh token, then we are unable to refresh it again.

    So how we refresh token on the old refresh token?

    The current solution is we are promoting a login form to user for asking his/her credentials to generate a new token. Now we have to stop promoting users because it's a bad way & bad user experience. And We don't need to change token TTL and refresh token TTL time.

    Your environment

    | Q | A | ----------------- | --- | Bug? | No | New Feature? | Yes | Framework | Laravel | Framework version | 5.4 (or any version 8.75) | Package version | 0.5.12 (or any version 1.0.2) | PHP version | 7.4.3 (or any version 8.0.0)

    Steps to reproduce

    Refresh the refresh token again.

    Expected behaviour

    Need to refresh token on old refresh token. If refresh token is timed out then it will behave normally.

    Actual behaviour

    Refresh token did not refreshed again & it's expired.

    opened by moxesh-gandhi 0
  • how automatically redis key generated on my server ?

    how automatically redis key generated on my server ?

    Subject of the issue

    automatically fake redis key generated with empty value in Laravel Framework 5.4.36

    Your environment

    | Q | how automatically redis key generated on my server ? | ----------------- | --- | Bug? | yes | New Feature? | no | Framework | Laravel | Framework version | 5.4.36 | Package version | 2.5.1 | PHP version | 7.4.3

    Steps to reproduce

    in my server i use the redis server for cache and also use some libraries redis, predis, jwt and zizaco entrus, also see with specific version like bellow in my project composer.json file

    "require": {
       "illuminate/redis": "5.4.*",
       "predis/predis": "^1.1",
       "tymon/jwt-auth": "0.5.*",
       "zizaco/entrust": "5.2.x-dev"
    },
    

    i attached the screenshot about the fake empty redis key automatically generated and my redis server is going high and i face the issue enter image description here

    so how can i solve it?

    Expected behaviour

    i expected what exactly going on this issue, how and when it's created fake redis key with empty data

    Actual behaviour

    i try to resolve this issue in my code review and i can't not get solution

    opened by jignesh-ob 1
  • Update lcobucci/jwt package version

    Update lcobucci/jwt package version

    update lcobucci/jwt to 4.0.4 or to 3.4.6

    There is a critical vulnerability issue in this package that is used in your package and it needs upgrade

    Your environment

    | Framework | Lumen | Framework version | 8 | Package version | 3.4.0 | PHP version | 7.4

    opened by johnabil 1
  • Unable to refresh token

    Unable to refresh token

    I'm using JWT in Laravel 7 It's config file is

    <?php
    
    /*
     * This file is part of jwt-auth.
     *
     * (c) Sean Tymon <[email protected]>
     *
     * For the full copyright and license information, please view the LICENSE
     * file that was distributed with this source code.
     */
    
    return [
    
        /*
        |--------------------------------------------------------------------------
        | JWT Authentication Secret
        |--------------------------------------------------------------------------
        |
        | Don't forget to set this in your .env file, as it will be used to sign
        | your tokens. A helper command is provided for this:
        | `php artisan jwt:secret`
        |
        | Note: This will be used for Symmetric algorithms only (HMAC),
        | since RSA and ECDSA use a private/public key combo (See below).
        |
        */
    
        'secret' => env('JWT_SECRET'),
    
        /*
        |--------------------------------------------------------------------------
        | JWT Authentication Keys
        |--------------------------------------------------------------------------
        |
        | The algorithm you are using, will determine whether your tokens are
        | signed with a random string (defined in `JWT_SECRET`) or using the
        | following public & private keys.
        |
        | Symmetric Algorithms:
        | HS256, HS384 & HS512 will use `JWT_SECRET`.
        |
        | Asymmetric Algorithms:
        | RS256, RS384 & RS512 / ES256, ES384 & ES512 will use the keys below.
        |
        */
    
        'keys' => [
    
            /*
            |--------------------------------------------------------------------------
            | Public Key
            |--------------------------------------------------------------------------
            |
            | A path or resource to your public key.
            |
            | E.g. 'file://path/to/public/key'
            |
            */
    
            'public' => env('JWT_PUBLIC_KEY'),
    
            /*
            |--------------------------------------------------------------------------
            | Private Key
            |--------------------------------------------------------------------------
            |
            | A path or resource to your private key.
            |
            | E.g. 'file://path/to/private/key'
            |
            */
    
            'private' => env('JWT_PRIVATE_KEY'),
    
            /*
            |--------------------------------------------------------------------------
            | Passphrase
            |--------------------------------------------------------------------------
            |
            | The passphrase for your private key. Can be null if none set.
            |
            */
    
            'passphrase' => env('JWT_PASSPHRASE'),
    
        ],
    
        /*
        |--------------------------------------------------------------------------
        | JWT time to live
        |--------------------------------------------------------------------------
        |
        | Specify the length of time (in minutes) that the token will be valid for.
        | Defaults to 1 hour.
        |
        | You can also set this to null, to yield a never expiring token.
        | Some people may want this behaviour for e.g. a mobile app.
        | This is not particularly recommended, so make sure you have appropriate
        | systems in place to revoke the token if necessary.
        | Notice: If you set this to null you should remove 'exp' element from 'required_claims' list.
        |
        */
    
        //'ttl' => env('JWT_TTL',1440),
        'ttl' => env('JWT_TTL',5),
        //'ttl' => null,
    
        /*
        |--------------------------------------------------------------------------
        | Refresh time to live
        |--------------------------------------------------------------------------
        |
        | Specify the length of time (in minutes) that the token can be refreshed
        | within. I.E. The user can refresh their token within a 2 week window of
        | the original token being created until they must re-authenticate.
        | Defaults to 2 weeks.
        |
        | You can also set this to null, to yield an infinite refresh time.
        | Some may want this instead of never expiring tokens for e.g. a mobile app.
        | This is not particularly recommended, so make sure you have appropriate
        | systems in place to revoke the token if necessary.
        |
        */
    
        'refresh_ttl' => env('JWT_REFRESH_TTL', 20160),
        //'refresh_ttl' => null,
    
        /*
        |--------------------------------------------------------------------------
        | JWT hashing algorithm
        |--------------------------------------------------------------------------
        |
        | Specify the hashing algorithm that will be used to sign the token.
        |
        | See here: https://github.com/namshi/jose/tree/master/src/Namshi/JOSE/Signer/OpenSSL
        | for possible values.
        |
        */
    
        'algo' => env('JWT_ALGO', 'HS256'),
    
        /*
        |--------------------------------------------------------------------------
        | Required Claims
        |--------------------------------------------------------------------------
        |
        | Specify the required claims that must exist in any token.
        | A TokenInvalidException will be thrown if any of these claims are not
        | present in the payload.
        |
        */
    
        'required_claims' => [
            'iss',
            'iat',
            'exp',
            'nbf',
            'sub',
            'jti',
        ],
    
        /*
        |--------------------------------------------------------------------------
        | Persistent Claims
        |--------------------------------------------------------------------------
        |
        | Specify the claim keys to be persisted when refreshing a token.
        | `sub` and `iat` will automatically be persisted, in
        | addition to the these claims.
        |
        | Note: If a claim does not exist then it will be ignored.
        |
        */
    
        'persistent_claims' => [
            // 'foo',
            // 'bar',
        ],
    
        /*
        |--------------------------------------------------------------------------
        | Lock Subject
        |--------------------------------------------------------------------------
        |
        | This will determine whether a `prv` claim is automatically added to
        | the token. The purpose of this is to ensure that if you have multiple
        | authentication models e.g. `App\User` & `App\OtherPerson`, then we
        | should prevent one authentication request from impersonating another,
        | if 2 tokens happen to have the same id across the 2 different models.
        |
        | Under specific circumstances, you may want to disable this behaviour
        | e.g. if you only have one authentication model, then you would save
        | a little on token size.
        |
        */
    
        'lock_subject' => true,
    
        /*
        |--------------------------------------------------------------------------
        | Leeway
        |--------------------------------------------------------------------------
        |
        | This property gives the jwt timestamp claims some "leeway".
        | Meaning that if you have any unavoidable slight clock skew on
        | any of your servers then this will afford you some level of cushioning.
        |
        | This applies to the claims `iat`, `nbf` and `exp`.
        |
        | Specify in seconds - only if you know you need it.
        |
        */
    
        'leeway' => env('JWT_LEEWAY', 0),
    
        /*
        |--------------------------------------------------------------------------
        | Blacklist Enabled
        |--------------------------------------------------------------------------
        |
        | In order to invalidate tokens, you must have the blacklist enabled.
        | If you do not want or need this functionality, then set this to false.
        |
        */
    
        'blacklist_enabled' => env('JWT_BLACKLIST_ENABLED', true),
    
        /*
        | -------------------------------------------------------------------------
        | Blacklist Grace Period
        | -------------------------------------------------------------------------
        |
        | When multiple concurrent requests are made with the same JWT,
        | it is possible that some of them fail, due to token regeneration
        | on every request.
        |
        | Set grace period in seconds to prevent parallel request failure.
        |
        */
    
        'blacklist_grace_period' => env('JWT_BLACKLIST_GRACE_PERIOD', 0),
    
        /*
        |--------------------------------------------------------------------------
        | Cookies encryption
        |--------------------------------------------------------------------------
        |
        | By default Laravel encrypt cookies for security reason.
        | If you decide to not decrypt cookies, you will have to configure Laravel
        | to not encrypt your cookie token by adding its name into the $except
        | array available in the middleware "EncryptCookies" provided by Laravel.
        | see https://laravel.com/docs/master/responses#cookies-and-encryption
        | for details.
        |
        | Set it to true if you want to decrypt cookies.
        |
        */
    
        'decrypt_cookies' => false,
    
        /*
        |--------------------------------------------------------------------------
        | Providers
        |--------------------------------------------------------------------------
        |
        | Specify the various providers used throughout the package.
        |
        */
    
        'providers' => [
    
            /*
            |--------------------------------------------------------------------------
            | JWT Provider
            |--------------------------------------------------------------------------
            |
            | Specify the provider that is used to create and decode the tokens.
            |
            */
    
            'jwt' => Tymon\JWTAuth\Providers\JWT\Lcobucci::class,
    
            /*
            |--------------------------------------------------------------------------
            | Authentication Provider
            |--------------------------------------------------------------------------
            |
            | Specify the provider that is used to authenticate users.
            |
            */
    
            'auth' => Tymon\JWTAuth\Providers\Auth\Illuminate::class,
    
            /*
            |--------------------------------------------------------------------------
            | Storage Provider
            |--------------------------------------------------------------------------
            |
            | Specify the provider that is used to store tokens in the blacklist.
            |
            */
    
            'storage' => Tymon\JWTAuth\Providers\Storage\Illuminate::class,
    
        ],
    
    ];
    

    Created middleware :

    class JwtMiddleware extends BaseMiddleware
    {
        /**
         * Handle an incoming request.
         *
         * @param  \Illuminate\Http\Request  $request
         * @param  \Closure  $next
         * @return mixed
         */
        public function handle($request, Closure $next)
        {
              /**
         * Handle an incoming request.
         *
         * @param  \Illuminate\Http\Request  $request
         * @param  \Closure  $next
         * @return mixed
         */
    
        try {
            $user = JWTAuth::parseToken()->authenticate();
        } catch (Exception $e) {  //ddh($e);
            if ($e instanceof \Tymon\JWTAuth\Exceptions\TokenInvalidException){
                return response()->json(['error' => 'Token is Invalid'],401);
            }else if ($e instanceof \Tymon\JWTAuth\Exceptions\TokenExpiredException){  
                try
                {   
                  $refreshed = JWTAuth::refresh(JWTAuth::getToken());
                  $user = JWTAuth::setToken($refreshed)->toUser();
                  $request->headers->set('Authorization','Bearer '.$refreshed);  
                }catch (JWTException $e){
                    return response()->json(['error' => 'Token is Invalid'],401);
                }
            }
            else if($e instanceof \Tymon\JWTAuth\Exceptions\TokenBlacklistedException)
            {  
                return response()->json(['error' => 'Token is Invalid'],401);
            }
            else if($e instanceof \Tymon\JWTAuth\Exceptions\TokenInvalidException)
            {  
                return response()->json(['error' => 'Token is Invalid'],401);
            }
            else if($e instanceof \Tymon\JWTAuth\Exceptions\JWTException)
            {  
                return response()->json(['error' => 'Token is Invalid'],401);
            }
            else{
                return response()->json(['error' => 'Authorization Token not found'],401);
            }
        }
        return $next($request);
        }
    

    In my case if i set 'ttl' => env('JWT_TTL',5), to 5 then my token is blacklisted and i'm getting

    Tymon\JWTAuth\Exceptions\TokenBlacklistedException: The token has been blacklisted in file

    and it is not refreshed

    opened by danishkhan3621 0
  • Blacklisted token

    Blacklisted token

    Blacklisted token @ line 4 : if Blacklisted token @ line 6 : if

    Style checker detected errors

    this is my code i dont understand what is wrong

    k, n = map(int, input().split()) f1 = n // k f2 = 0 if f1 == (n / k): f2 = k if f1 != (n / k): f1 = n // k + 1 f2 = n - k * (f1 - 1) print(f1, f2)

    opened by TheRanch18 0
Releases(1.0.2)
  • 1.0.2(Nov 27, 2020)

    :sparkles: Improvements

    • Prevent installation of lcobucci/jwt 3.4 and above due to breaking deprecation notice in laravel https://github.com/tymondesigns/jwt-auth/issues/2059
    Source code(tar.gz)
    Source code(zip)
  • 1.0.1(Sep 8, 2020)

  • 1.0.0(Mar 5, 2020)

    :sparkles: Improvements

    • Compatible with Laravel 7

    :boom: Breaking changes

    • Drop support for Laravel 5.1
    • Drop support for Cartalyst Sentinel
    Source code(tar.gz)
    Source code(zip)
  • 1.0.0-rc.5.1(Jan 21, 2020)

  • 1.0.0-rc.5(Sep 12, 2019)

    :sparkles: Improvements

    • Compatible with Laravel 6 (4908d376687bc836e463d851a842d5f0c1c8f494)
    • Added "always-no" option to secret generate command (59421160e5713f14972a72edce7c63ba6a1e3332)
    Source code(tar.gz)
    Source code(zip)
  • 1.0.0-rc.4.1(Mar 14, 2019)

    :bug: Bug fixes

    • Do not add to blacklist if it already exists (63698d304554e5d0bc3eb481cc260a9fc900e151)
    • Fix issue with php 5 (1ce697e1fa280bf22196bc397b324bc9997b90b3)
    Source code(tar.gz)
    Source code(zip)
  • 1.0.0-rc.4(Mar 12, 2019)

    :sparkles: Improvements

    • Compatible with Laravel 5.8 (34d8e48b2a3dd779f37e53fcb76f37e69e8cdd25)
    • Compatible with Carbon 2 (8dfa7952bf752ea1867fcb038a92e01e4b0d8668)

    :bug: Bug fixes

    • Allow nbf claim to be in the future (b860a4ca219d6d76374445cffd9836b1bd1db9a6)

    :art: Other

    • Increase generated secret key length in jwt:secret command to 64 characters (f72b8eb0deff2c002d40a8b0411a546c28ebec98)
    Source code(tar.gz)
    Source code(zip)
  • 1.0.0-rc.3(Sep 20, 2018)

    :sparkles: Improvements

    • Compatible with Laravel 5.7 (#1655)
    • Added JWTProvider (#1505)
    • JWTGuard is now macroable (#1604)
    • Reset claims collection when creating a payload (#1589)

    :art: Other

    JWTAuth also respects the lock_subject config (#1545)


    👍 Huge thank you to everyone who contributed to this release!

    ℹ️ The next release will be 1.0.0 and I will be stepping up activity on this repo very soon. Thanks for bearing with me 🙏

    Source code(tar.gz)
    Source code(zip)
  • 1.0.0-rc.2(Feb 9, 2018)

    :sparkles: Improvements

    • Compatible with Laravel 5.6
    • Add config option for lock_subject, allowing the removal of the prv claim, if you don't have multiple guards (7c1d58e294b255c4afa31c121b11b947e8699cbe)
    • Add ability to specify leeway to help with clock skew (#1453)
    • Add lcobucci jwt provider, since namshi/jose has been abandoned (#1453)
    • Cookies can now be decrypted (#1363)

    :bug: Fixes

    • Fix jwt:secret command

    :art: Other

    • Tested on php 7.2
    • Tons of other improvements, including code style fixes and even more test coverage

    :boom: Breaking changes

    • auth()->getToken() now returns null instead of false if the token is not present.

    👍 Huge thank you to everyone who contributed to this release!

    Source code(tar.gz)
    Source code(zip)
  • 1.0.0-rc.1(Aug 31, 2017)

    :sparkles: Improvements

    • Compatible with Laravel 5.5 💥 (#1278) (#1255)
    • Support for multiple guards (#1167)
    • More sensible order of claim overrides (#1222)

    :bug: Fixes

    • Fix for Lumen empty request issue (#1243)
    • Fix jwt:secret command not returning when it should (5b4785e45671a45fdb23d3b3df5c9c31681d547c)

    :art: Other

    • Adding code of conduct
    • Tons of other improvements, including code style fixes and even more test coverage

    Full docs will be ready for the final 1.0.0 release

    👍 Huge thank you to everyone who contributed to this release!

    @lucasmichot @cappuc @crynobone @miscbits @MitchellMcKenna @KennedyTedesco @DanielMcAssey @hughsaffar @nachodd

    Source code(tar.gz)
    Source code(zip)
  • 0.5.12(Jun 7, 2017)

  • 0.5.11(Apr 6, 2017)

  • 1.0.0-beta.3(Mar 25, 2017)

  • 1.0.0-beta.2(Jan 30, 2017)

  • 1.0.0-beta.1(Nov 20, 2016)

  • 1.0.0-alpha.3(Sep 6, 2016)

  • 1.0.0-alpha.2(Apr 21, 2016)

  • 1.0.0-alpha1(Mar 7, 2016)

    Tagging an alpha version of the next release.

    No documentation just yet (soon) so only use if you know what you're doing :smile:

    Will populate here with a quick start soon too

    Source code(tar.gz)
    Source code(zip)
  • 0.5.9(Feb 18, 2016)

  • 0.5.8(Feb 17, 2016)

  • 0.5.7(Feb 16, 2016)

    Some bug fixes brought over from develop branch.

    • Allow Auth exceptions to bubble up to the surface (948518e1bc4752ab1f8fda78d8a615673d7ee6ef)
    • Improve testing mock stability (20185f7bfa94ed0ddf4934c755cd795479eee148)
    • Enabling blacklisting of expired-but-refreshable tokens (7b89b50da7b50d1e2608cfe060490d396f2f0d6a)
    • Other small improvements and tweaks
    Source code(tar.gz)
    Source code(zip)
  • 0.5.6(Nov 24, 2015)

  • 0.5.5(Sep 15, 2015)

  • 0.5.4(Jul 2, 2015)

  • 0.5.3(Apr 26, 2015)

    • fixes token refreshing where token is wrongly deemed expired - see #102
    • fixes issue where refresh ttl not passed from config
    • other small improvements
    Source code(tar.gz)
    Source code(zip)
  • 0.4.3(Apr 20, 2015)

  • 0.5.2(Apr 20, 2015)

  • 0.5.1(Apr 7, 2015)

  • 0.4.2(Apr 7, 2015)

A simple library to work with JSON Web Token and JSON Web Signature

JWT A simple library to work with JSON Web Token and JSON Web Signature based on the RFC 7519. Installation Package is available on Packagist, you can

Luís Cobucci 6.8k Jan 3, 2023
Un proyecto que crea una API de usuarios para registro, login y luego acceder a su información mediante autenticación con JSON Web Token

JSON WEB TOKEN CON LARAVEL 8 Prueba de autenticación de usuarios con una API creada en Laravel 8 Simple, fast routing engine. License The Laravel fram

Yesser Miranda 2 Oct 10, 2021
Implements a Refresh Token system over Json Web Tokens in Symfony

JWTRefreshTokenBundle The purpose of this bundle is manage refresh tokens with JWT (Json Web Tokens) in an easy way. This bundles uses LexikJWTAuthent

Marcos Gómez Vilches 568 Dec 28, 2022
JSON Web Token (JWT) for webman plugin

JSON Web Token (JWT) for webman plugin Json web token (JWT), 是为了在网络应用环境间传递声明而执行的一种基于JSON的开放标准((RFC 7519).该token被设计为紧凑且安全的,特别适用于分布式站点的单点登录(SSO)场景。

 ShaoBo Wan(無尘) 25 Dec 30, 2022
Minimalistic token-based authorization for Laravel API endpoints.

Bearer Minimalistic token-based authorization for Laravel API endpoints. Installation You can install the package via Composer: composer require ryang

Ryan Chandler 74 Jun 17, 2022
Authentication REST-API built with Lumen PHP Framework

Authentication REST-API built with Lumen PHP Framework Laravel Lumen is a stunningly fast PHP micro-framework for building web applications with expre

Hüseyin Yağlı 1 Oct 12, 2021
It's a Laravel 8 authentication markdown that will help you to understand and grasp all the underlying functionality for Session and API Authentication

About Auth Starter It's a Laravel 8 authentication markdown that will help you to understand and grasp all the underlying functionality for Session an

Sami Alateya 10 Aug 3, 2022
Rinvex Authy is a simple wrapper for @Authy TOTP API, the best rated Two-Factor Authentication service for consumers, simplest 2fa Rest API for developers and a strong authentication platform for the enterprise.

Rinvex Authy Rinvex Authy is a simple wrapper for Authy TOTP API, the best rated Two-Factor Authentication service for consumers, simplest 2fa Rest AP

Rinvex 34 Feb 14, 2022
phpCAS is an authentication library that allows PHP applications to easily authenticate users via a Central Authentication Service (CAS) server.

phpCAS is an authentication library that allows PHP applications to easily authenticate users via a Central Authentication Service (CAS) server.

Apereo Foundation 780 Dec 24, 2022
Basic Authentication handler for the JSON API, used for development and debugging purposes

Basic Authentication handler This plugin adds Basic Authentication to a WordPress site. Note that this plugin requires sending your username and passw

WordPress REST API Team 667 Dec 31, 2022
Laravel web rest api authentication library (PHP).

Webi auth library Laravel web rest api authentication library. Install (laravel 9, php 8.1) First set your .env variables (mysql, smtp) and then compo

Atomjoy 2 Nov 25, 2022
Multi-factor Authentication using a Public PGP key for web based applications

PGPmfa() a PHP Class for PGP Multi-factor Authentication using a Public PGP key for web based applications Multi-factor Authentication with PGP Second

null 2 Nov 27, 2022
An OAuth 2.0 bridge for Laravel and Lumen [DEPRECATED FOR LARAVEL 5.3+]

OAuth 2.0 Server for Laravel (deprecated for Laravel 5.3+) Note: This package is no longer maintaned for Laravel 5.3+ since Laravel now features the P

Luca Degasperi 2.4k Jan 6, 2023
Making Laravel Passport work with Lumen

lumen-passport Making Laravel Passport work with Lumen A simple service provider that makes Laravel Passport work with Lumen Dependencies PHP >= 5.6.3

Denis Mysenko 651 Dec 1, 2022
JWT auth for Laravel and Lumen

JWT Artisan Token auth for Laravel and Lumen web artisans JWT is a great solution for authenticating API requests between various services. This packa

⑅ Generation Tux ⑅ 141 Dec 21, 2022
An invisible reCAPTCHA package for Laravel, Lumen, CI or native PHP.

Invisible reCAPTCHA Why Invisible reCAPTCHA? Invisible reCAPTCHA is an improved version of reCAPTCHA v2(no captcha). In reCAPTCHA v2, users need to cl

Albert Chen 578 Nov 30, 2022
🔑 Simple Keycloak Guard for Laravel / Lumen

Simple Keycloak Guard for Laravel / Lumen This package helps you authenticate users on a Laravel API based on JWT tokens generated from Keycloak Serve

Robson Tenório 277 Jan 3, 2023
HTTP Basic Auth Guard for Lumen 5.x

HTTP Basic Auth Guard HTTP Basic Auth Guard is a Lumen Package that lets you use basic as your driver for the authentication guard in your application

Christopher Lass 40 Nov 11, 2022
:octocat: Socialite is an OAuth2 Authentication tool. It is inspired by laravel/socialite, you can easily use it without Laravel.

Socialite Socialite is an OAuth2 Authentication tool. It is inspired by laravel/socialite, You can easily use it in any PHP project. 中文文档 This tool no

安正超 1.2k Dec 22, 2022