PHP Classes
elePHPant
Icontem

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

Recommend this page to a friend!
  Info   View files Documentation   View files View files (44)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2019-11-11 (1 month ago) RSS 2.0 feedNot yet rated by the usersTotal: 97 This week: 58All time: 9,300 This week: 2Up
Version License PHP version Categories
lumen-jwt-api 1.0.0The PHP License5PHP 5, Web services
Description Author

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.

Innovation Award
PHP Programming Innovation award nominee
November 2019
Nominee
Vote
JSON Web Tokens, also known JWT, are used by APIs to implement stronger security means to interact between API clients and servers.

This package provides means to create an API based on the Laravel framework, implementing JWT to make the API more secure.

Manuel Lemos
  Performance   Level  
Name: Nahidul Hasan <contact>
Classes: 4 packages by
Country: Bangladesh Bangladesh
Age: ???
All time rank: 334945 in Bangladesh Bangladesh
Week rank: 4 Up1 in Bangladesh Bangladesh Up
Innovation award
Innovation award
Nominee: 3x

 

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.

  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

 Version Control Unique User Downloads Download Rankings  
 100%
Total:97
This week:58
All time:9,300
This week:2Up