Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 18, 2024 via composer

tymon/jwt-auth 2.0.0

JSON Web Token Authentication for Laravel and Lumen
Package summary
Share
0
issues
2
licenses
59
MIT
1
BSD-3-Clause
Package created
4 Sep 2014
Version published
16 Feb 2023
Maintainers
1
Total deps
60
Direct deps
8
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
59 Packages, Including:
brick/math@0.11.0
carbonphp/carbon-doctrine-types@3.2.0
doctrine/inflector@2.0.10
fruitcake/php-cors@v1.3.0
guzzlehttp/uri-template@v1.0.3
illuminate/auth@v10.48.10
illuminate/bus@v10.48.10
illuminate/collections@v10.48.10
illuminate/conditionable@v10.48.10
illuminate/console@v10.48.10
illuminate/container@v10.48.10
illuminate/contracts@v10.48.10
illuminate/database@v10.38.1
illuminate/events@v10.48.10
illuminate/filesystem@v10.48.10
illuminate/http@v10.48.10
illuminate/macroable@v10.48.10
illuminate/pipeline@v10.48.10
illuminate/queue@v10.48.10
illuminate/session@v10.48.10
illuminate/support@v10.48.10
illuminate/view@v10.48.10
laravel/prompts@v0.1.21
laravel/serializable-closure@v1.3.3
lcobucci/clock@3.2.0
nesbot/carbon@2.72.3
nunomaduro/termwind@v1.15.1
psr/clock@1.0.0
psr/container@2.0.2
psr/event-dispatcher@1.0.0
psr/log@3.0.0
psr/simple-cache@3.0.0
ramsey/collection@2.0.0
ramsey/uuid@4.7.6
symfony/console@v6.4.7
symfony/deprecation-contracts@v3.5.0
symfony/error-handler@v7.0.7
symfony/event-dispatcher@v7.0.7
symfony/event-dispatcher-contracts@v3.5.0
symfony/finder@v6.4.7
symfony/http-foundation@v6.4.7
symfony/http-kernel@v6.4.7
symfony/mime@v6.4.7
symfony/polyfill-ctype@v1.29.0
symfony/polyfill-intl-grapheme@v1.29.0
symfony/polyfill-intl-idn@v1.29.0
symfony/polyfill-intl-normalizer@v1.29.0
symfony/polyfill-mbstring@v1.29.0
symfony/polyfill-php72@v1.29.0
symfony/polyfill-php80@v1.29.0

BSD 3-Clause "New" or "Revised" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
use-trademark
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
lcobucci/jwt@4.3.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

8
All Dependencies CSV
β“˜ This is a list of tymon/jwt-auth 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
illuminate/authv10.48.10-MIT
prod
illuminate/consolev10.48.10-MIT
prod dev
illuminate/contractsv10.48.10-MIT
prod
illuminate/databasev10.38.1334.64 kBMIT
prod dev
illuminate/httpv10.48.10-MIT
prod
illuminate/supportv10.48.10-MIT
prod
lcobucci/jwt4.3.0-BSD-3-Clause
prod
nesbot/carbon2.72.3766.72 kBMIT
prod dev

Visualizations

Frequently Asked Questions

What does tymon/jwt-auth do?

Tymon/JWT-auth is a specialized composer package that provides JSON Web Token Authentication for Laravel and Lumen. It is a powerful tool that lets developers add a layer of security to their web application by facilitating user authentication through JWTs. With a robust variety of features, tymon/jwt-auth is designed to seamlessly integrate with Laravel, one of the most popular PHP frameworks.

How do you use tymon/jwt-auth?

To use the tymon/jwt-auth package, first, you need to install it via composer by running the composer require tymon/jwt-auth command in your project directory. Once installed, you may need to publish the package configuration using php artisan vendor:publish --provider="Tymon\JWTAuth\Providers\LaravelServiceProvider". This command publishes the JWT configuration file to your Laravel configuration folder.

Here's a very simple usage example:

use Tymon\JWTAuth\Facades\JWTAuth;

try {
    if (! $token = JWTAuth::attempt($credentials)) {
        return response()->json(['error' => 'invalid_credentials'], 400);
    }
} catch (JWTException $e) {
    return response()->json(['error' => 'could_not_create_token'], 500);
}

return response()->json(compact('token'));

In this example, you would replace $credentials with an array of user credentials like ['email' => 'user1@example.com', 'password' => 'password'].

When the user credentials are authenticated successfully, a JWT token is returned. If the credentials are invalid, a JSON response with an error message is returned.

Remember, the package greatly simplifies the process of issuing and validating JWTs. It is flexible enough to fit into most of the typical JWT-based authentication setups.

Where are the tymon/jwt-auth docs?

The documentation for tymon/jwt-auth can be found at jwt-auth.com. This extensive online guide provides a comprehensive breakdown of all the methods and functionalities incorporated into the package, equipped with illustrative examples and clear instructions that ease the understanding of the tool, guiding the developer through the process of successful implementation into their projects.