All Projects → miguelgrinberg → Flask Httpauth

miguelgrinberg / Flask Httpauth

Licence: mit
Simple extension that provides Basic, Digest and Token HTTP authentication for Flask routes

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Flask Httpauth

Flask Base
A simple Flask boilerplate app with SQLAlchemy, Redis, User Authentication, and more.
Stars: ✭ 2,680 (+181.81%)
Mutual labels:  flask, authentication
Go Guardian
Go-Guardian is a golang library that provides a simple, clean, and idiomatic way to create powerful modern API and web authentication.
Stars: ✭ 204 (-78.55%)
Mutual labels:  authentication, tokens
Tokens
Java library for conveniently verifying and storing OAuth 2.0 service access tokens
Stars: ✭ 142 (-85.07%)
Mutual labels:  authentication, tokens
Ziggurat foundations
Framework agnostic set of sqlalchemy classes that make building applications that require permissions an easy task.
Stars: ✭ 67 (-92.95%)
Mutual labels:  flask, authentication
Flask simplelogin
Simple Login - Login Extension for Flask - maintainer @cuducos
Stars: ✭ 133 (-86.01%)
Mutual labels:  flask, authentication
Auth0 Python Api Samples
Auth0 Integration Samples for Python REST API Services using Flask
Stars: ✭ 70 (-92.64%)
Mutual labels:  flask, authentication
Flask Restful Authentication
An example for RESTful authentication using nginx, uWSGI, Flask, MongoDB and JSON Web Token(JWT).
Stars: ✭ 63 (-93.38%)
Mutual labels:  flask, authentication
Bottle Cork
Authentication module for the Bottle and Flask web frameworks
Stars: ✭ 174 (-81.7%)
Mutual labels:  flask, authentication
Flask Appbuilder
Simple and rapid application development framework, built on top of Flask. includes detailed security, auto CRUD generation for your models, google charts and much more. Demo (login with guest/welcome) - http://flaskappbuilder.pythonanywhere.com/
Stars: ✭ 3,603 (+278.86%)
Mutual labels:  flask, authentication
Neurodo
A web tool for the analysis of cognitive dysfunction in patient journaling during Schizophrenia clinical drug trials
Stars: ✭ 14 (-98.53%)
Mutual labels:  flask
Flask Boto3
Flask extension that ties boto3 connectors to the application context
Stars: ✭ 27 (-97.16%)
Mutual labels:  flask
Deepstream.io
deepstream.io server
Stars: ✭ 6,947 (+630.49%)
Mutual labels:  authentication
Devise Jwt
JWT token authentication with devise and rails
Stars: ✭ 881 (-7.36%)
Mutual labels:  authentication
Peeplus
python+vue3前后端分离项目
Stars: ✭ 28 (-97.06%)
Mutual labels:  flask
Nebular
💥 Customizable Angular UI Library based on Eva Design System 🌚✨Dark Mode
Stars: ✭ 7,368 (+674.76%)
Mutual labels:  authentication
Jetweet
Jetweet is a mini twitter clone with basic functionalities, Made using ASP.NET CORE and Entity framework technologies
Stars: ✭ 29 (-96.95%)
Mutual labels:  authentication
System dashboard
Boilerplate project - Cross-Platform System Dashboard using Flask, React, Mobx and Web-Workers
Stars: ✭ 13 (-98.63%)
Mutual labels:  flask
Access
Ponzu Addon to manage API access grants and tokens for authentication
Stars: ✭ 13 (-98.63%)
Mutual labels:  authentication
Hapi Auth Keycloak
JSON Web Token based Authentication powered by Keycloak
Stars: ✭ 29 (-96.95%)
Mutual labels:  authentication
Corpus Christi
Church management suite, open source, fully internationalized
Stars: ✭ 29 (-96.95%)
Mutual labels:  flask

Flask-HTTPAuth

Build status codecov

Simple extension that provides Basic and Digest HTTP authentication for Flask routes.

Installation

The easiest way to install this is through pip.

pip install Flask-HTTPAuth

Basic authentication example

from flask import Flask
from flask_httpauth import HTTPBasicAuth
from werkzeug.security import generate_password_hash, check_password_hash

app = Flask(__name__)
auth = HTTPBasicAuth()

users = {
    "john": generate_password_hash("hello"),
    "susan": generate_password_hash("bye")
}

@auth.verify_password
def verify_password(username, password):
    if username in users and \
            check_password_hash(users.get(username), password):
        return username

@app.route('/')
@auth.login_required
def index():
    return "Hello, %s!" % auth.current_user()

if __name__ == '__main__':
    app.run()

Note: See the documentation for more complex examples that involve password hashing and custom verification callbacks.

Digest authentication example

from flask import Flask
from flask_httpauth import HTTPDigestAuth

app = Flask(__name__)
app.config['SECRET_KEY'] = 'secret key here'
auth = HTTPDigestAuth()

users = {
    "john": "hello",
    "susan": "bye"
}

@auth.get_password
def get_pw(username):
    if username in users:
        return users.get(username)
    return None

@app.route('/')
@auth.login_required
def index():
    return "Hello, %s!" % auth.username()

if __name__ == '__main__':
    app.run()

Resources

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