Demo: https://voting.deknot.io
- Clone the repo and
cdinto it composer install- Rename or copy
.env.examplefile to.env php artisan key:generate- Setup a database and add your database credentials in your
.envfile php artisan migrateorphp artisan migrate --seedif you want seed datanpm installnpm run devornpm run watchphp artisan serveor use Laravel Valet- Visit
localhost:8000in 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.phpis 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