Social connections powered by Authlib.
Switch branches/tags
Nothing to show
Clone or download
Latest commit 337b43b Nov 9, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
django_example Add django example Apr 28, 2018
flask_example OAuth1 requires a cache instance. Oct 10, 2018
loginpass Reformat code import Nov 9, 2018
.gitignore Add django example Apr 28, 2018
LICENSE Fix license, readme Apr 22, 2018
MANIFEST.in Init project Apr 7, 2018
Makefile Add setup files Apr 7, 2018
README.md Update readme Nov 6, 2018
README.rst Release v0.1 Apr 28, 2018
setup.cfg Add setup files Apr 7, 2018
setup.py Version bump 0.2 Sep 16, 2018

README.md

Authlib Loginpass

Social connections powered by Authlib. This library is a part of Authlib project. It works well with Authlib v0.7+.

from flask import Flask
from authlib.flask.client import OAuth
from loginpass import create_flask_blueprint, GitHub

app = Flask(__name__)
oauth = OAuth(app)

def handle_authorize(remote, token, user_info):
    if token:
        save_token(remote.name, token)
    if user_info:
        save_user(user_info)
        return user_page
    raise some_error

github_bp = create_flask_blueprint(GitHub, oauth, handle_authorize)
app.register_blueprint(github_bp, url_prefix='/github')

Useful Links

Features

Authlib Loginpass contains lots of connections (see below), every connection has a profile() method which returns the same format of user info. It supports OAuth 1, OAuth 2 and OpenID Connect for now.

The user info that profile() returns is standardized with OpenID Connect UserInfo claims, not something made by me.

Connections

Connections that Authlib Loginpass contains:

  • Google
  • GitHub
  • Gitlab
  • Twitter
  • Facebook
  • Dropbox
  • Reddit
  • Linkedin
  • Azure
  • Discord
  • Slack
  • Jira
  • StackOverflow
  • Bitbucket
  • Auth0
  • Strava
  • Spotify
  • Yandex
  • Twitch
  • VK

Usage

Loginpass is just a simple wrapper around Authlib, it is configured apps ready to use with Flask and Django. Checkout the examples for details.

License

Loginpass is a group member of Authlib, it is licensed under AGPLv3+. Authlib commercial license applies to this project too, you can get a commercial license at Authlib Commercial Plans.