Feb 20, 2016
This tutorial is based on Laravel 5 token based Authentication (OAuth 2.0) & Dingo Wiki.They both have some bugs and I fixed them.
1.Install a new Laravel Project and of coures you have to set up your database.
composer.json and run
composer update to include extra packages.
3.Add new providers in your
And this lines to the aliases array:
$routeMiddleware in your
php artisan vendor:publish and
php artisan migrate in your project folder.
Add the following settings in you
app\config\oauth2.php like this:
6.Now is your
7.You’ll need a client to make your oauth2 server runs.
In the database find the
oauth_client s Table , insert new record to it ,or you can use the following SQL code in phpMyAdmin:
8.Edit your Api Controllers.
You can add models named Book,Post,User as you like,here is an example:
9.Test your server now!
We are almost done.Now you need to test the server you’ve just set up.We can use tools like PostMan to emulate requests to your server.
Back To Top