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
File details
Details for the file Flask-Authlib-Client-0.0.1.tar.gz
.
File metadata
- Download URL: Flask-Authlib-Client-0.0.1.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b35f4631195cfc1cc9c0909bce49673df9df8e7065c6335cc22af8bc0165d00d |
|
MD5 | 8015513f8dd1e10dd0eb57bf57486df9 |
|
BLAKE2b-256 | 2b1d0610d6820102e12d4f496ac512e8dae4cfd15a91a6a6c08d76b271a37cc8 |
File details
Details for the file Flask_Authlib_Client-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: Flask_Authlib_Client-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9fae33edc3baf106b98f3155565e840efdcef6067f0c7aec4cc7a3bf3c260842 |
|
MD5 | 5c127f4e9cb7fc8256fa6d29b35e0696 |
|
BLAKE2b-256 | 1f45a8a598c70f4067cbfe333e032d8a1e10aec02759c184cd749e650b27bd4f |