Code Monkey home page Code Monkey logo

passport-multiauth-demo's Introduction

Passport-Multiauth Demo

This project is an implementation sample using the package Passport-Multiauth.

Packages

  • Laravel Framework 5.6.*
  • Laravel Passport ^7.0
  • Passport-Multiauth ^3.0

Installation

Clone project and access the project folder:

git clone https://github.com/sfelix-martins/passport-multiauth-demo.git
cd passport-multiauth-demo

Copy the .env.example to .env file and set your local configurations:

cp .env.example .env

Install dependencies:

composer install

Generate the encryption key:

php artisan key:generate

Migrate database (Don't forget of configure your database credentials on .env file):

php artisan migrate

Install laravel passport

php artisan passport:install

Using

To create an access token you can use the route /api/login to create an personal access token or oauth/token to use the default laravel passport.

To use the route api/login you need pass the params username, password and provider. The code will try login the user and generate an access token.

The oauth/token route just add a new param provider to default laravel passport route.

Important files

  • Config
    • config/auth.php
    • App\Providers\AuthServiceProvider
    • App\Http\Kernel
  • Migrations
    • database/migrations/*
  • Seeders
    • database/seeds/UsersTableSeeder.php
  • Entities
    • App\Admin
    • App\User
  • Routes
    • routes/api.php
  • Controllers
    • App\Controllers\LoginController
  • Services
    • App\Model\Authenticator

Todo

  • Add unit tests
  • Add instructions to use with laradock environment
  • Improve documentation

passport-multiauth-demo's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.