All Projects → agile4you → Bottle Jwt

agile4you / Bottle Jwt

Licence: gpl-3.0
JWT Authentication Plugin for bottle.py applications.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Bottle Jwt

Naperg
Fullstack Boilerplate GraphQL. Made with React & Prisma + authentication & roles
Stars: ✭ 661 (+2103.33%)
Mutual labels:  authentication, jwt, jwt-authentication
Barong
Barong auth server
Stars: ✭ 100 (+233.33%)
Mutual labels:  authentication, jwt, jwt-authentication
Authentication Server
A simple authentication service to deliver JWT with Hasura claims, based on users with multiples roles stored in a Postgres database.
Stars: ✭ 48 (+60%)
Mutual labels:  authentication, jwt, jwt-authentication
Express Mongodb Rest Api Boilerplate
A boilerplate for Node.js apps / Rest API / Authentication from scratch - express, mongodb (mongoose).
Stars: ✭ 153 (+410%)
Mutual labels:  authentication, jwt, jwt-authentication
Emqx Auth Jwt
EMQ X JWT Authentication Plugin
Stars: ✭ 26 (-13.33%)
Mutual labels:  authentication, jwt, 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 (+9376.67%)
Mutual labels:  authentication, jwt, jwt-authentication
Jose Jwt
Ultimate Javascript Object Signing and Encryption (JOSE) and JSON Web Token (JWT) Implementation for .NET and .NET Core
Stars: ✭ 692 (+2206.67%)
Mutual labels:  jwt, jwt-authentication
Auth0.js
Auth0 headless browser sdk
Stars: ✭ 755 (+2416.67%)
Mutual labels:  authentication, jwt
Spring Boot Jwt
JWT auth service using Spring Boot, Spring Security and MySQL
Stars: ✭ 795 (+2550%)
Mutual labels:  authentication, jwt
Devise Jwt
JWT token authentication with devise and rails
Stars: ✭ 881 (+2836.67%)
Mutual labels:  authentication, jwt
Next Auth
Authentication for Next.js
Stars: ✭ 8,362 (+27773.33%)
Mutual labels:  authentication, jwt
Go Book Store Api
Go Sample project to understand Mysql CRUD operation with best practises Includes logging, JWT, Swagger and Transactions
Stars: ✭ 18 (-40%)
Mutual labels:  jwt, jwt-authentication
Fastify Esso
The easiest authentication plugin for Fastify, with built-in support for Single sign-on
Stars: ✭ 20 (-33.33%)
Mutual labels:  authentication, jwt
Simplemall
基于SpringCloud的微服务架构实战案例项目,以一个简单的购物流程为示例,融合spring cloud 相关组件,如spring-cloud-netflix、swagger等
Stars: ✭ 687 (+2190%)
Mutual labels:  jwt, jwt-authentication
Hasura Backend Plus
🔑Auth and 📦Storage for Hasura. The quickest way to get Auth and Storage working for your next app based on Hasura.
Stars: ✭ 776 (+2486.67%)
Mutual labels:  authentication, jwt
Django Graphql Jwt
JSON Web Token (JWT) authentication for Graphene Django
Stars: ✭ 649 (+2063.33%)
Mutual labels:  authentication, jwt
Silhouette
Silhouette is a framework agnostic authentication library for Scala that supports several authentication methods, including OAuth2, OpenID Connect, Credentials, Basic Authentication or custom authentication schemes.
Stars: ✭ 18 (-40%)
Mutual labels:  authentication, jwt
Oc Jwtauth Plugin
JWTAuth Plugin for OctoberCMS.
Stars: ✭ 8 (-73.33%)
Mutual labels:  jwt, jwt-authentication
Php Storageless Sessions
Sessions handler which stores session data in HMAC-signed and encrypted cookies
Stars: ✭ 29 (-3.33%)
Mutual labels:  jwt, jwt-authentication
Jwt Node Vue
Repositório responsável pelo primeiro projeto da série de vídeos: Coding Stuff.
Stars: ✭ 29 (-3.33%)
Mutual labels:  jwt, jwt-authentication

bottle_jwt: JSON Web Token authentication plugin for bottle.py

.. image:: https://travis-ci.org/agile4you/bottle-jwt.svg?branch=master :target: https://travis-ci.org/agile4you/bottle-jwt

.. image:: https://coveralls.io/repos/agile4you/bottle-jwt/badge.svg?branch=master&service=github :target: https://coveralls.io/github/agile4you/bottle-jwt?branch=master

Example Usage

.. code:: python

import bottle
from bottle_jwt import (JWTProviderPlugin, jwt_auth_required)


app = bottle.Bottle()

server_secret = '*Y*^%JHg7623'


class AuthBackend(object):
    """Implementing an auth backend class with at least two methods.
    """
    user = {'id': 1237832, 'username': 'pav', 'password': '123', 'data': {'sex': 'male', 'active': True}}

    def authenticate_user(self, username, password):
        """Authenticate User by username and password.

        Returns:
            A dict representing User Record or None.
        """
        if username == self.user['username'] and password == self.user['password']:
            return self.user
        return None

    def get_user(self, user_id):
        """Retrieve User By ID.

        Returns:
            A dict representing User Record or None.
        """
        if user_id == self.user['id']:
            return {k: self.user[k] for k in self.user if k != 'password'}
        return None


provider_plugin = JWTProviderPlugin(
    keyword='jwt',
    auth_endpoint='/auth',
    backend=AuthBackend(),
    fields=('username', 'password'),
    secret=server_secret,
    ttl=30
)

app.install(provider_plugin)


@app.get('/')
@jwt_auth_required
def private_resource():
    return {"scope": "For your eyes only!", "user": bottle.request.get_user()}


bottle.run(app=app, port=9092, host='0.0.0.0', reloader=True)

Registered endpoints::

- POST /auth - d {"username": <username>, "password": <password>}.
    *Returns a JSON object*: {"token": <auth_token>}

- GET / -headers Authorization: JWT <auth_token>.
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].