krisanalfa / Lumen Jwt
Lumen with JWT Authentication, Dingo API and CORS Support
Stars: ✭ 258
Projects that are alternatives of or similar to Lumen Jwt
Jwt Auth Guard
JWT Auth Guard for Laravel and Lumen Frameworks.
Stars: ✭ 319 (+23.64%)
Mutual labels: lumen, jwt-authentication
shopping-cart
A simple Shopping-cart built with React and Django REST Framework(DRF)
Stars: ✭ 41 (-84.11%)
Mutual labels: jwt-authentication
munhasir
Sample RESTful single page web app with Go, MongoDB and VueJS. A platform for keeping diaries for those who are cautious(or paranoid).
Stars: ✭ 24 (-90.7%)
Mutual labels: jwt-authentication
Security
ASP.NET Security Providers for CloudFoundry
Stars: ✭ 27 (-89.53%)
Mutual labels: jwt-authentication
nextjs-cors
🎉 nextjs-cors is a node.js package to provide a Connect/Express middleware that can be used to enable CORS with various options 🚀
Stars: ✭ 97 (-62.4%)
Mutual labels: cors
jwtpp
JSON Object Signing and Encryption library for C++.
Stars: ✭ 57 (-77.91%)
Mutual labels: jwt-authentication
twitch-chat-visualizer
A Node.js Project. Would you like to see your chat stream with a custom design? This is for you!
Stars: ✭ 14 (-94.57%)
Mutual labels: cors
Quora
Building An Exclusive Community of PEC Graduates and Students.The main features of the website are “PEC Quora” and “PEC Connect”
Stars: ✭ 26 (-89.92%)
Mutual labels: jwt-authentication
todo-app
🔥 REST API для приложения списков ToDo
Stars: ✭ 78 (-69.77%)
Mutual labels: jwt-authentication
jwt auth example
Example of how to use JWT for user authorization and API route protection. Made with Express, Node.js, and JWT.
Stars: ✭ 23 (-91.09%)
Mutual labels: jwt-authentication
jwt-auth
JSON Web Token Authentication for Laravel and Lumen
Stars: ✭ 46 (-82.17%)
Mutual labels: lumen
react-redux-jwt-authentication-boilerplate
React-Redux JWT Authentication Boilerplate
Stars: ✭ 44 (-82.95%)
Mutual labels: jwt-authentication
Kodkod
https://github.com/alirizaadiyahsi/Nucleus Web API layered architecture startup template with ASP.NET Core 2.1, EF Core 2.1 and Vue Client
Stars: ✭ 45 (-82.56%)
Mutual labels: jwt-authentication
reactjs-login-register-crud
ReactJS CRUD Application, ReactJS FileUpload, ReactJS Sample application, ReactJS Boilerplate, ReactJS Login, ReactJS FileUpload, ReactJS Register
Stars: ✭ 47 (-81.78%)
Mutual labels: jwt-authentication
caddy-authorize
Authorization Plugin for Caddy v2 (JWT/PASETO)
Stars: ✭ 235 (-8.91%)
Mutual labels: jwt-authentication
Jwt Spring Security Demo
This is a demo for using JWT (JSON Web Token) with Spring Security and
Spring Boot. I completely rewrote my first version. Now this solution is based on the code base
from the JHipster Project. I tried to extract the minimal configuration and classes that are needed
for JWT-Authentication and did some changes.
Stars: ✭ 2,843 (+1001.94%)
Mutual labels: jwt-authentication
Lumen with JWT Authentication
Basically this is a starter kit for you to integrate Lumen with JWT Authentication. If you want to Lumen + Dingo + JWT for your current application, please check here.
What's Added
- Lumen 5.4.
- JWT Auth for Lumen Application. [1]
- Dingo to easily and quickly build your own API. [1]
- Lumen Generator to make development even easier and faster.
- CORS and Preflight Request support.
[1] Added via this package.
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 viagit clone
- Run
composer install
- Run
php artisan jwt:generate
- Configure your
.env
file for authenticating via database - Set the
API_PREFIX
parameter in your .env file (usuallyapi
). - Run
php artisan migrate --seed
A Live PoC
- Run a PHP built in server from your root project:
php -S localhost:8000 -t public/
Or via artisan command:
php artisan serve
To authenticate a user, make a POST
request to /api/auth/login
with parameter as mentioned below:
email: [email protected]
password: johndoe
Request:
curl -X POST -F "[email protected]" -F "password=johndoe" "http://localhost:8000/api/auth/login"
Response:
{
"success": {
"message": "token_generated",
"token": "a_long_token_appears_here"
}
}
- With token provided by above request, you can check authenticated user by sending a
GET
request to:/api/auth/user
.
Request:
curl -X GET -H "Authorization: Bearer a_long_token_appears_here" "http://localhost:8000/api/auth/user"
Response:
{
"success": {
"user": {
"id": 1,
"name": "John Doe",
"email": "[email protected]",
"created_at": null,
"updated_at": null
}
}
}
- To refresh your token, simply send a
PATCH
request to/api/auth/refresh
. - Last but not least, you can also invalidate token by sending a
DELETE
request to/api/auth/invalidate
. - To list all registered routes inside your application, you may execute
php artisan route:list
⇒ php artisan route:list
+--------+----------------------+---------------------+------------------------------------------+------------------+------------+
| Verb | Path | NamedRoute | Controller | Action | Middleware |
+--------+----------------------+---------------------+------------------------------------------+------------------+------------+
| POST | /api/auth/login | api.auth.login | App\Http\Controllers\Auth\AuthController | postLogin | |
| GET | /api | api.index | App\Http\Controllers\APIController | getIndex | jwt.auth |
| GET | /api/auth/user | api.auth.user | App\Http\Controllers\Auth\AuthController | getUser | jwt.auth |
| PATCH | /api/auth/refresh | api.auth.refresh | App\Http\Controllers\Auth\AuthController | patchRefresh | jwt.auth |
| DELETE | /api/auth/invalidate | api.auth.invalidate | App\Http\Controllers\Auth\AuthController | deleteInvalidate | jwt.auth |
+--------+----------------------+---------------------+------------------------------------------+------------------+------------+
ETC
I made a Postman collection here.
License
Laravel and Lumen is a trademark of Taylor Otwell
Sean Tymon officially holds "Laravel JWT" license
Donation
If this project help you reduce time to develop, you can give me a cup of coffee :)
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].