Skip to content

authlib/loginpass

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
November 29, 2020 13:40
October 21, 2019 08:26
November 29, 2020 13:40
November 30, 2018 15:09
April 10, 2019 22:23
April 7, 2018 16:16
November 30, 2018 15:09
December 19, 2018 22:08

Authlib Loginpass

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

Build Status PyPI Version Follow Twitter

from flask import Flask
from authlib.integrations.flask_client import OAuth
from loginpass import create_flask_blueprint
from loginpass import Twitter, GitHub, Google

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

backends = [Twitter, GitHub, Google]
bp = create_flask_blueprint(backends, oauth, handle_authorize)
app.register_blueprint(bp, url_prefix='')

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:

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

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.

Alternatives

Most of the time, you don't have to use loginpass, you can just register a remote app with Authlib's framework integrations. Checkout our demo on OAuth clients for Flask, Django, Starlette and FastAPI:

https://github.com/authlib/demo-oauth-client

License

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