Skip to content

lscortesc/oauth-server

Repository files navigation

Oauth Server

Base repository to create an Oauth2 server, it is written in Laravel with Passport component and it is consume them by self with login proxy.

alt text

Install

  1. Go to project root folder and run
composer install
  1. Configure DB Connection in .env file
  2. Run migrations
php artisan migrate
  1. Install passport component
php artisan passport:install
  1. Save clients secrets. You will see something like this:
Encryption keys generated successfully.
Personal access client created successfully.
Client ID: 1
Client Secret: CLIENT_SECRET_1
Password grant client created successfully.
Client ID: 2
Client Secret: CLIENT_SECRET_2
  1. Configure .env file with password client:
PASSWORD_CLIENT_ID=2
PASSWORD_CLIENT_SECRET=CLIENT_SECRET_2
  1. If you are deploying Passport to your production servers for the first time, you will likely need to run the passport:keys command.
php artisan passport:keys

Also you can visit the official documentation here

Configuration

  • You can configure expiration time of a token and also the refresh token in boot method of:
app/Providers/AuthServiceProvider.php
  • To verify the available routes, run:
php artisan route:list

About

Laravel Oauth Server with Passport

Resources

Stars

Watchers

Forks

Packages

No packages published