No project description provided
Project description
Simple OAuth library to work with sanic. Basically, just rewrited version of aioauth_client with async/await syntax and some optimization. Can be used only with python 3.5/3.6.
Available providers (in alphabetic order):
Amazon
BitBucket
BitBucket v2
Discord (thanks to @smlbiobot)
Eventbrite
Facebook
Flickr
Foursquare
Github
GitLab
Google
LinkedIn
Meetup
ok.ru
Pinterest
Plurk
Tumblr
Twitter
Vimeo
vk.com
Yahoo
Yandex
Requirements
python >= 3.6
Installation
Just install via pip:
pip install sanic_oauth
Note, that to use blueprint correctly, you need to additionally install sanic and sanic-session.
Usage
Simple way for use this is blueprint with oauth configuration.
But, before use it you need to:
Create
aiohttp.ClientSessionand bind to app likeasync_sessionvariable.Create session interface from
sanic-sessionpackage and bind it to app likesession_interfacevariable.Configure
app.configsettings. You should passOAUTH_PROVIDER, OAUTH_REDIRECT_URI, OAUTH_SCOPEand another settings, for example,OAUTH_CLIENT_ID, OAUTH_CLIENT_SECRET. Every setting withOAUTHprefix will be passed to oauth provider construction.Apply blueprint
Add decorator
login_requiredto routes, that required oauth.
You can see example for more details.
Advanced usage
If you don’t like current blueprint, you always can use providers directly and implements you own logic, like in old_example.
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 Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sanic_oauth-0.4.0-py2.py3-none-any.whl.
File metadata
- Download URL: sanic_oauth-0.4.0-py2.py3-none-any.whl
- Upload date:
- Size: 15.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1aedc8df17b627d5053cd320b86edb77936979b07b81d382c3915e220982f1b
|
|
| MD5 |
ac9167504d3cfb7d57f2d6a531fbde67
|
|
| BLAKE2b-256 |
dde13c714a897c2931232aab6a3caa7a22f4cdfe99badd3b1d4f1dea63ade1f1
|