luchavez / passport-pgt-client
Laravel Passport Password Grant Tokens Client for Laravel 8|9|10
Requires
- php: ^8.0
- illuminate/support: ~8|~9|~10
- luchavez/api-sdk-kit: ^1.0
Requires (Dev)
- orchestra/testbench: ~6|~7|~8
- phpunit/phpunit: ~9.0
- roave/security-advisories: dev-latest
This package is auto-updated.
Last update: 2024-10-17 08:53:41 UTC
README
Laravel Passport is an authentication package for Laravel. It is used by a lot of Laravel apps to authenticate users before accessing any resources. Basically, it generates an access token
which you can then use on every request to provide identification to the OAuth Server
.
One of Laravel Passport's mostly used authentication methods is the Password Grant Tokens
grant type. It is a stateless way to get access tokens
and refresh tokens
from the OAuth Server
.
Take a look at contributing.md if you want to contribute to this project.
Installation
Via Composer
// Install the package $ composer require luchavez/passport-pgt-client // Publish the config $ php artisan pgt:client:install
Setting Up
- Add these variables to
.env
file if you want to override the default values.
Usage
Passport PGT Client
The package provides a service called PassportPgtClient which you can use by calling its helper functions:
passportPgtClient()
passport_pgt_client()
Here's the list of its available methods.
Routes
Here's the list of routes that this package provides.
Note: If you wish to override the login, refresh token, logout, or get self logic, feel free to do so by updating the published passport-pgt-client
config file.
Examples
- Logging in a user
- Refreshing tokens
- Getting user's information based on access token
- Logging out a user
Change log
Please see the changelog for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please email jamescarloluchavez@gmail.com instead of using the issue tracker.
Credits
License
MIT. Please see the license file for more information.