bitly/oauth2-proxy compatible library to decode and validate authenticated cookie.
Project description
Support library to be used with bitly/oauth2_proxy to validate and decode the Cookie passed upstream. The library provide a Flask extension to authorize requests based on the Cookie.
The reference implementation in Go is located here.
Example
from flask import request, abort
from oauth2_proxy_cookie import Validator
secret = <oauth2_proxy cookie secret>
validator = Validator(secret, '_oauth2_proxy')
cookie = request.headers.get('Cookie')
value, time = validator.validate(cookie)
Or with Flask extension:
from flask import request, abort
from oauth2_proxy_cookie import Validator
app = flask.Flask('Foo')
oauth2_proxy = OAuth2ProxyCookie()
oauth2_proxy.init_app(app, allowed=['/public_path'])
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
Close
Hashes for oauth2-proxy-cookie-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 290ed4620c9f118b0d7c7ad4e134f3d12822c63f314c268c394dd8e31ad99c98 |
|
MD5 | 4156f5247875d981912e6101edf0c193 |
|
BLAKE2b-256 | 9bfb7493b065ddffc5208b71b483291aefa88548593b4147692cb593ebd05450 |