Laravel Lumen is a stunningly fast PHP micro-framework for building web applications with expressive, elegant syntax. Documentation for the framework can be found on the Lumen website.
Lumen PHP Framework version 5.1.*
This is simple example of how to use league/oauth2-serve inside Lumen PHP Framework.
- Client Credentials
- Authorization Code
- Refresh Token
Authorization Code grant is automatically executed after logging in a user in this implementation, so you will not have any authorization approval user interface.
You can modify the Authorization Code grant implementation or remove it by modifying the UserController file. You can find OAuth2 trait usage there. But remember, you need to figure out by your self on how to identify authenticated User by removing the implementation.
Run composer install from the command line
composer install
Import SQL table schema into your database.
Import Postman JSON file into your Postman application.
- Change all URL endpoints based on your installation.
- Run the "Authorization".
- Copy access_token value into the "User Login" Authorization header, then run it.
- Copy refresh_token value into the "Refresh Token" body, then run it.
- Copy access_token value into the "Get a User" Authorization header, then run it.
This middleware will identify Client based on access_token passed to the request, then it will save the identified OAuth info (client, user, and scopes) into request object.
This middleware will identify authenticated User based on identified OAuth info, so you need to put OAuthMiddleware in the first place of you route middleware definition before this middleware.
Submit your issue in here.
Whole additional source codes included is open-sourced software licensed under the MIT license