OAuth2 module for the Lumen PHP framework.
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.
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.
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,
]);
Please read the guidelines.
See LICENSE.