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:.
Metadata
Release files for Flask-Authlib-Client 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| Flask-Authlib-Client-0.0.1.tar.gz | 2.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| Flask_Authlib_Client-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.2 kB
Release files / Flask-Authlib-Client-0.0.1.tar.gz
| Download URL | Flask-Authlib-Client-0.0.1.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b35f4631195cfc1cc9c0909bce49673df9df8e7065c6335cc22af8bc0165d00d
|
|
BLAKE2b-256 checksum How to use checksums |
2b1d0610d6820102e12d4f496ac512e8dae4cfd15a91a6a6c08d76b271a37cc8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / Flask_Authlib_Client-0.0.1-py3-none-any.whl
| Download URL | Flask_Authlib_Client-0.0.1-py3-none-any.whl |
|---|---|
| Size | 3.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9fae33edc3baf106b98f3155565e840efdcef6067f0c7aec4cc7a3bf3c260842
|
|
BLAKE2b-256 checksum How to use checksums |
1f45a8a598c70f4067cbfe333e032d8a1e10aec02759c184cd749e650b27bd4f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|