Demo: https://voting.deknot.io
- Clone the repo and
cd
into it composer install
- Rename or copy
.env.example
file to.env
php artisan key:generate
- Setup a database and add your database credentials in your
.env
file php artisan migrate
orphp artisan migrate --seed
if you want seed datanpm install
npm run dev
ornpm run watch
php artisan serve
or use Laravel Valet- Visit
localhost:8000
in your browser - Access Nova via
/admin
- Install Laravel Passport in Oauth Server application: https://laravel.com/docs/8.x/passport
- Create Passport Client via:
php artisan passport:client
(Read more about Requesting Tokens process: https://laravel.com/docs/8.x/passport#requesting-tokens) - Add these env variables into your voting app .env
DEKNOT_CLIENT_ID=1 // Client ID in oauth_clients table of your Oauth Server application.
DEKNOT_CLIENT_SECRET= // Secret in oauth_clients table of your Oauth Server application.
DEKNOT_CLIENT_REDIRECT=http://voting.test/deknot/auth/callback // Callback URL of the voting application.
DEKNOT_PASSPORT_SERVER=http://gp.test // Oauth Server application URL
- Make sure your
api.php
is using Passport (auth:api
):
Route::middleware('auth:api')->get('/user', function (Request $request) {
return $request->user();
});
Voting app will make a request to that route to get the user information of you Saas app.
- Customize (Optional)
App\Oauth\DeKnotProvider.php
App\Http\Controllers\Auth\LoginWithDeKnotController.php