An extension to add support for separate resource server authentication to authlib
Project description
Flask-Authlib-Client
Flask-Authlib-Client is a Flask extension that adds support for separate authorization/resource servers. It extends authlib's flask integration. This extension is heavily inspired by django-oauth-toolkit
Install
$ pip install Flask-Authlib-Client
Usage
from flask import Flask
from authlib.integrations.flask_client import OAuth
from flask_authlib_client import AuthClient
class Config:
# Other configurations
RESOURCE_SERVER_INTROSPECTION_URL = 'http://someurl'
RESOURCE_SERVER_INTROSPECTION_CREDENTIALS = ('test', 'test') # Client id and secret to authorization server
app = Flask(__name__)
app.config.from_object(Config)
oauth = OAuth(app)
ac = AuthClient(app, oauth)
# protect your endpoints
@app.route('/')
@ac.require_oauth()
def example():
return 'Ok'
@app.route('/')
@ac.require_oauth('home') # Specify scope
def example():
return 'Ok'
Issues
Feel free to raise any issue here.
Contributions
All contributions are welcome:smile:.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for Flask-Authlib-Client-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b35f4631195cfc1cc9c0909bce49673df9df8e7065c6335cc22af8bc0165d00d |
|
MD5 | 8015513f8dd1e10dd0eb57bf57486df9 |
|
BLAKE2b-256 | 2b1d0610d6820102e12d4f496ac512e8dae4cfd15a91a6a6c08d76b271a37cc8 |
Close
Hashes for Flask_Authlib_Client-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9fae33edc3baf106b98f3155565e840efdcef6067f0c7aec4cc7a3bf3c260842 |
|
MD5 | 5c127f4e9cb7fc8256fa6d29b35e0696 |
|
BLAKE2b-256 | 1f45a8a598c70f4067cbfe333e032d8a1e10aec02759c184cd749e650b27bd4f |