nordsoftware / lumen-oauth2
OAuth2 module for the Lumen PHP framework.
Requires
- php: >=5.6
- league/oauth2-server: ^4.1
- nesbot/carbon: ^1.21
- nordsoftware/lumen-core: ^2.0
Requires (Dev)
- codeception/codeception: ^2.2
- codeception/specify: ^0.4
- codeception/verify: ^0.3
- laravel/lumen-framework: ^5.4
- satooshi/php-coveralls: ^1.0
Suggests
- nordsoftware/lumen-oauth2-doctrine: Doctrine storage connector
- nordsoftware/lumen-oauth2-doctrine-odm: Doctrine MongoDB storage connector
- nordsoftware/lumen-oauth2-eloquent: Eloquent storage connector
This package is not auto-updated.
Last update: 2020-01-24 15:51:27 UTC
README
OAuth2 module for the Lumen PHP framework.
Requirements
Usage
Installation
Run the following command to install the package through Composer:
composer require nordsoftware/lumen-oauth2
Install a storage connector by running one of the following commands:
composer require nordsoftware/lumen-oauth2-doctrine
or
composer require nordsoftware/lumen-oauth2-eloquent
or you can build your own.
Configure
Copy the configuration template in config/oauth2.php
to your application's config
directory and modify according to your needs.
For more information see the Configuration Files section in the Lumen documentation.
Bootstrapping
Add the following lines to bootstrap/app.php
:
$app->configure('oauth2');
Depending on the storage connector in use, register the correct service provider, e.g.
$app->register(Nord\Lumen\OAuth2\Doctrine\DoctrineServiceProvider::class);
Then the OAuth2 module service provider.
$app->register(Nord\Lumen\OAuth2\OAuth2ServiceProvider::class);
And to use the middleware for authenticating users.
$app->routeMiddleware([ ..... Nord\Lumen\OAuth2\Middleware\OAuth2Middleware::class, ]);
Contributing
Please read the guidelines.
License
See LICENSE.