Overview of Authlib Loginpass
masterAuthlib Loginpass is a library designed to provide social connections (social login capabilities) powered by Authlib. It is a specialized component of the larger Authlib project ecosystem.
repository·master·Indexed 43 days ago
https://github.com/authlib/loginpassA high-level library for implementing social logins with pre-configured OAuth and OpenID Connect provider connections. It provides standardized user profiles and integrates with frameworks like Flask and Django. Requires Authlib v0.14.3+.
profile() method. This method returns user information in a standardized format based on OpenID Connect UserInfo claims. This ensures that regardless of the provider (Google, GitHub, etc.), the user data structure remains consistent for your application logic.Authlib Loginpass provides a high-level wrapper around Authlib to simplify social connections in Flask and Django applications. To use it with Flask, you need to:
OAuth instance.handle_authorize) that processes the remote provider, the token, and the user_info.Twitter, GitHub, Google).create_flask_blueprint and register it with your app.Note: This library works best with Authlib v0.14.3+.
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='')Loginpass supports OAuth 1, OAuth 2, and OpenID Connect for a wide variety of providers. The following connections are currently available: