PHP Classes
elePHPant
Icontem

Lumen PHP JWT API Authentication: Create an API that supports JSON Web tokens

Recommend this page to a friend!

  Author Author  
Name: Nahidul Hasan <contact>
Classes: 4 packages by
Country: Bangladesh Bangladesh
Innovation award
Innovation award
Nominee: 2x


  Detailed description   Download Download .zip .tar.gz  
This package can be used to create an API that supports JSON Web tokens (JWT).

It provides an API that uses JWT for authentication of users that can access the API.

Separate configuration files allow configuring the several aspects of JWT.

Details

Lumen with JWT Authentication

Basically this is a starter kit for you to integrate Lumen with JWT Authentication

Quick Start

  • Clone this repo or download it's release archive and extract it somewhere
  • You may delete .git folder if you get this code via git clone
  • Run composer install
  • Configure your .env file for authenticating via database
  • Run docker-compose build
  • Run docker-compose up -d
  • Run the following command to populate database tables and seeds.

    `bash $ docker-compose exec php php artisan migrate --seed `

  • Visit localhost:8084

> Note: - You can now use: - `POST /auth/login` ?> with email and password, obtain a JWT token - `GET /posts` ?> anyone gets a list of all the posts in the database - `POST /posts` ?> any authenticated user (using JWT, for instance) can create a post - `PUT /posts/:post_id ` ?> the Owner of :post_id (authenticated using JWT, for instance) can modify the post

And remember, JWT requires you to provide the token as a header.


  Classes of Nahidul Hasan  >  Lumen PHP JWT API Authentication  >  Download Download .zip .tar.gz  >  Support forum Support forum  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  

 

Name: Lumen PHP JWT API Authentication
Base name: lumen-jwt-api
Description: Create an API that supports JSON Web tokens
Version: -
PHP version: 5
License: The PHP License
 
  Groups   Applications   Files Files  

  Groups  
Group folder image PHP 5 Classes using PHP 5 specific features View top rated classes
Group folder image Web services Web data clipping, SOAP or XML-RPC clients and servers View top rated classes


  Applications that use this package  
No pages of applications that use this class were specified.

Add link image If you know an application of this package, send a message to the author to add a link here.

  Files folder image Files  
File Role Description
Files folder imageapp (2 files, 8 directories)
Files folder imagebootstrap (1 file)
Files folder imageconfig (2 files)
Files folder imagedatabase (3 directories)
Files folder imagedocker (1 file, 2 directories)
Files folder imagepublic (2 files)
Files folder imageroutes (1 file)
Files folder imagetests (2 files)
Accessible without login Plain text file .env.example Data Auxiliary data
Accessible without login Plain text file artisan Example Example script
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file docker-compose.yml Data Auxiliary data
Accessible without login Plain text file docker-compose.yml.example Data Auxiliary data
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file readme.md Doc. Documentation

  Files folder image Files  /  app  
File Role Description
Files folder imageConsole (1 file)
Files folder imageEvents (2 files)
Files folder imageExceptions (1 file)
Files folder imageHttp (2 directories)
Files folder imageJobs (2 files)
Files folder imageListeners (1 file)
Files folder imagePolicies (1 file)
Files folder imageProviders (3 files)
  Plain text file Post.php Class Class source
  Plain text file User.php Class Class source

  Files folder image Files  /  app  /  Console  
File Role Description
  Plain text file Kernel.php Class Class source

  Files folder image Files  /  app  /  Events  
File Role Description
  Plain text file Event.php Class Class source
  Plain text file ExampleEvent.php Class Class source

  Files folder image Files  /  app  /  Exceptions  
File Role Description
  Plain text file Handler.php Class Class source

  Files folder image Files  /  app  /  Http  
File Role Description
Files folder imageControllers (4 files)
Files folder imageMiddleware (2 files)

  Files folder image Files  /  app  /  Http  /  Controllers  
File Role Description
  Plain text file AuthController.php Class Class source
  Plain text file Controller.php Class Class source
  Plain text file ExampleController.php Class Class source
  Plain text file PostController.php Class Class source

  Files folder image Files  /  app  /  Http  /  Middleware  
File Role Description
  Plain text file Authenticate.php Class Class source
  Plain text file ExampleMiddleware.php Class Class source

  Files folder image Files  /  app  /  Jobs  
File Role Description
  Plain text file ExampleJob.php Class Class source
  Plain text file Job.php Class Class source

  Files folder image Files  /  app  /  Listeners  
File Role Description
  Plain text file ExampleListener.php Class Class source

  Files folder image Files  /  app  /  Policies  
File Role Description
  Plain text file PostPolicy.php Class Class source

  Files folder image Files  /  app  /  Providers  
File Role Description
  Plain text file AppServiceProvider.php Class Class source
  Plain text file AuthServiceProvider.php Class Class source
  Plain text file EventServiceProvider.php Class Class source

  Files folder image Files  /  bootstrap  
File Role Description
  Plain text file app.php Class Class source

  Files folder image Files  /  config  
File Role Description
  Accessible without login Plain text file auth.php Conf. Configuration script
  Accessible without login Plain text file jwt.php Conf. Configuration script

  Files folder image Files  /  database  
File Role Description
Files folder imagefactories (1 file)
Files folder imagemigrations (2 files)
Files folder imageseeds (2 files)

  Files folder image Files  /  database  /  factories  
File Role Description
  Plain text file ModelFactory.php Class Class source

  Files folder image Files  /  database  /  migrations  
File Role Description
  Plain text file 2017_12_14_060409_create_users_table.php Class Class source
  Plain text file 2017_12_14_103515_create_posts_table.php Class Class source

  Files folder image Files  /  database  /  seeds  
File Role Description
  Plain text file DatabaseSeeder.php Class Class source
  Plain text file UsersTableSeeder.php Class Class source

  Files folder image Files  /  docker  
File Role Description
Files folder imagenginx (1 file)
Files folder imagephp (2 files)
  Accessible without login Plain text file Dockerfile Data Auxiliary data

  Files folder image Files  /  docker  /  nginx  
File Role Description
  Accessible without login Plain text file default.conf Data Auxiliary data

  Files folder image Files  /  docker  /  php  
File Role Description
  Accessible without login Plain text file custom.ini Data Auxiliary data
  Accessible without login Plain text file Dockerfile Data Auxiliary data

  Files folder image Files  /  public  
File Role Description
  Accessible without login Plain text file .htaccess Data Auxiliary data
  Accessible without login Plain text file index.php Example Example script

  Files folder image Files  /  routes  
File Role Description
  Accessible without login Plain text file web.php Example Example script

  Files folder image Files  /  tests  
File Role Description
  Plain text file ExampleTest.php Class Class source
  Plain text file TestCase.php Class Class source

Download Download all files: lumen-jwt-api.tar.gz lumen-jwt-api.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.