PHP Classes

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

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 159 All time: 8,989 This week: 455Up
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
Number 6
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
Picture of Nahidul Hasan
  Performance   Level  
Innovation award
Innovation award
Nominee: 7x

 

Documentation

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.

    $ 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 (44)  
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

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:159
This week:0
All time:8,989
This week:455Up