Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report

laravel/passport v11.10.2

Laravel Passport provides OAuth2 server support to Laravel.
Package summary
Share
0
issues
0
licenses
Package created
15 Aug 2016
Version published
17 Jan 2024
Maintainers
1
Total deps
0
Direct deps
0
License
MIT
Generating a report...
Hold on while we generate a fresh audit report for this package.

Frequently Asked Questions

What does laravel/passport do?

Laravel Passport is a popular package for Laravel (found at https://github.com/laravel/passport.git) that provides support for creating an OAuth2 server. OAuth2, standing for Open Authorization version 2, is an industry-standard protocol that allows for the authorization of a third-party application to provide a service on behalf of a user. In short, Laravel Passport makes handling API authentication in your Laravel applications simple and straightforward, promoting efficient and enjoyable development.

How do you use laravel/passport?

Using Laravel Passport involves adding the package to your Laravel project and configuring it for use.

Firstly, you need to include Laravel Passport through composer:

composer require laravel/passport

After successfully pulling in the package, migrate your database:

php artisan migrate

Next, you'll want to include Passport's service provider in your app/Providers/AuthServiceProvider.php file's boot method:

public function boot()
{
    $this->registerPolicies();

    Passport::routes();
}

Once you've registered the routes, you should run passport:install command:

php artisan passport:install

This will generate encryption keys required for generating secure access tokens. In addition, this command will create “personal access” and “password grant” clients which will be used for generating JWT tokens.

After this setup, you will be able to use OAuth2 authentication to protect endpoints in your Laravel application.

Where are the laravel/passport docs?

For more comprehensive instructions and usage details, the official Laravel Passport documentation can be viewed at the Laravel website. The direct link to the Laravel Passport documentation is: https://laravel.com/docs/passport. The documentation provides a complete guide to getting started and effectively using the Laravel Passport package, including a deep dive into more advanced topics such as issuing tokens, revoking tokens, and configuring middleware.