All Projects → rluders → jwtauth-plugin

rluders / jwtauth-plugin

Licence: GPL-3.0 License
JWTAuth Plugin for WinterCMS

Programming Languages

PHP
23972 projects - #3 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to jwtauth-plugin

EasyTokenGenerator
This repo aims to dynamically and simply generate tokens in Token Based systems.
Stars: ✭ 15 (-40%)
Mutual labels:  token, jwt-authentication, token-authentication
Node Express Mongodb Jwt Rest Api Skeleton
This is a basic API REST skeleton written on JavaScript using async/await. Great for building a starter web API for your front-end (Android, iOS, Vue, react, angular, or anything that can consume an API). Demo of frontend in VueJS here: https://github.com/davellanedam/vue-skeleton-mvp
Stars: ✭ 603 (+2312%)
Mutual labels:  token, jwt-authentication
reactjs-login-register-crud
ReactJS CRUD Application, ReactJS FileUpload, ReactJS Sample application, ReactJS Boilerplate, ReactJS Login, ReactJS FileUpload, ReactJS Register
Stars: ✭ 47 (+88%)
Mutual labels:  token, jwt-authentication
go-jwt-issuer
Microservice generates the pair of JSON web tokens - access-token and refresh-token are signed by user identifier.
Stars: ✭ 30 (+20%)
Mutual labels:  token, jwt-authentication
Express Mongodb Rest Api Boilerplate
A boilerplate for Node.js apps / Rest API / Authentication from scratch - express, mongodb (mongoose).
Stars: ✭ 153 (+512%)
Mutual labels:  token, jwt-authentication
phalcon-micro-rest-api-skeleton
This is a basic API REST skeleton written on Phalcon PHP. Great For building an MVP for your frontend app (Vue, react, angular, or anything that can consume an API)
Stars: ✭ 57 (+128%)
Mutual labels:  token, jwt-authentication
task-manager
Task Manager App
Stars: ✭ 19 (-24%)
Mutual labels:  jwt-authentication
pern-stack-auth
📋 Repair. PERN stack todo app with jwt user authentication
Stars: ✭ 17 (-32%)
Mutual labels:  jwt-authentication
horse-jwt
Middleware for JWT in HORSE
Stars: ✭ 39 (+56%)
Mutual labels:  token
nfw
A jsonapi boilerplate for @nfw-core with mikro-orm
Stars: ✭ 23 (-8%)
Mutual labels:  jwt-authentication
shopping-cart
A simple Shopping-cart built with React and Django REST Framework(DRF)
Stars: ✭ 41 (+64%)
Mutual labels:  jwt-authentication
node-rest-api-scaffold
This project is an initial NodeJS Rest API scaffold for developers
Stars: ✭ 24 (-4%)
Mutual labels:  jwt-authentication
crowdsale-smart-contract
No description or website provided.
Stars: ✭ 39 (+56%)
Mutual labels:  token
yii2-jwt-user
JWT (JSON Web Token) User component for Yii 2
Stars: ✭ 16 (-36%)
Mutual labels:  token
tokensubscription.com
⏰💰🤠 Set-it-and-forget-it token subscriptions on the Ethereum mainnet. #Winner #WyoHackathon
Stars: ✭ 81 (+224%)
Mutual labels:  token
XGoServer
一个基础性、模块完整且安全可靠的轻量级 Go 服务端框架
Stars: ✭ 21 (-16%)
Mutual labels:  token
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 (+80%)
Mutual labels:  jwt-authentication
brauzie
Awesome CLI for fetching JWT tokens for OAuth2.0 clients
Stars: ✭ 14 (-44%)
Mutual labels:  token
netty-chat-tutorial
Netty Chat tutorial with Protobuf
Stars: ✭ 23 (-8%)
Mutual labels:  jwt-authentication
axios-token-interceptor
An interceptor which makes it easier to work with tokens in axios.
Stars: ✭ 34 (+36%)
Mutual labels:  token

Introduction

This plugin provides a JSON Web Tokens authentication mechanism for Winter CMS integrated with Winter.User. It's essential for your web application built with Angular, Vue.js, React or other modern Javascript frameworks.

Requirements

Theme

Tutorials

Installation

$ composer require rluders/jwtauth

Configuration

You must set a secret token for your application. Do do it, on Winter's Backend access: Settings > Users > JWTAuth

Usage

Here's the list of available endpoints for this plugin.

If you are using Postman, you can click here to import the collection with all the calls that you need to test it.

Login

POST /api/auth/login

Route name

api.auth.login

Parameters

Name Type Required Description
login string Yes Account login attribute
password string Yes Account password

The field login value can be the account email or username. You can select it on Winter.User configuration what field should be used for login.

Responses

SUCCESS

Code: 200

{
  "token": string,
  "user": object
}

ERROR

Code: 401

{
  "error":
    invalid_credentials |
    could_not_create_token |
    user_inactive |
    user_is_banned
}

Register

POST /api/auth/register

Route name

api.auth.register

Parameters

Name Type Required Description
username string No Account username
email string Yes Account email
password string Yes Account password
password_confirmation string No Confirm the new password

The field username can be required. It depends of your Winter.User configuration.

Responses

SUCCESS

Code: 201

[]

ERROR

Code: 401

{
  "error": object | registration_disabled
}

Supported events

  • Winter.User.beforeRegister
  • Winter.User.register

Account Activation

POST /api/auth/account-activation

Route name

api.auth.account-activation

Parameters

Name Type Required Description
activation_code string Yes Account activation code

Responses

SUCCESS

Code: 200

[]

ERROR

Code: 422

{
  "error": invalid_activation_code | invalid_user | user_not_found
}

Forgot Password

POST /api/auth/forgot-password

Route name

api.auth.forgot-password

Parameters

Name Type Required Description
email string Yes Account email

Responses

SUCCESS

Code: 200

[]

ERROR

Code: 404

{
  "error": user_not_found
}

Reset Password

POST /api/auth/reset-password

Route name

api.auth.reset-password

Parameters

Name Type Required Description
reset_password_code string Yes Reset password code
password string Yes Account new password
password_confirmation string No Confirm the new password

Responses

SUCCESS

Code: 200

[]

ERROR

Code: 422

{
  "error":
    invalid_reset_password_code | invalid_user | invalid_reset_password_code
}

Refresh Token

POST /api/auth/refresh-token

Route name

auth.api.refresh-token

Parameters

Name Type Required Description
token string Yes Valid user JWToken

Responses

SUCCESS

Code: 200

{
  "token": string
}

ERROR

Code: 403

{
  "error": could_not_refresh_token | given_token_was_blacklisted
}

Get User

GET /api/auth/me

Middleware

jwt.auth

Route name

api.auth.me

Parameters

Name Type Required Description
token string Yes Valid token

Responses

SUCCESS

Code: 200

{
  "user": object
}

ERROR

Code: 404

{
  "error": user_not_found
}

Known issues

Beside the fact that I'm always trying to solve the possible issues, bad things could happen. Here, an list of possible issues and how to fix it.

Note to Apache users

In order to use the authorization Bearer Token you must add the following code to your .httaccess

RewriteEngine On
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]

License

GPLv3

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].