oauth2_proxy/oauth2-proxy compatible library to decode and validate authenticated cookie. compatible with cookie signed at sha256.Forked from isra17/oauth2-proxy-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.
Forked from https://github.com/isra17/oauth2-proxy-cookie to modify sign from sha1 to sha256.
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')
app.config.OAUTH2_PROXY_COOKIE_SECRET = <oauth2_proxy cookie secret>
oauth2_proxy = OAuth2ProxyCookie(force_https=True, allowed=['/public_path'])
oauth2_proxy.init_app(app)
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 oauth2-proxy-cookie-256-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd2b262f11b601c6f160a9fff5511649200b6fdfc11a8e35a75d13911e5965db |
|
MD5 | 5868080b947c8093bf7db9794456354a |
|
BLAKE2b-256 | 695c2385d6a9dffa32800796dd80e36d22a76a6790bd87d6e7fc5531e77a9cdf |
Close
Hashes for oauth2_proxy_cookie_256-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1ec8751f4c4eaf9e631aeadac3c709b91552f8c204bc31da46556f43440c7f0 |
|
MD5 | e117fc8d4a5c5c31e96b6bc9bf75317e |
|
BLAKE2b-256 | a52f11fc70f9e7ba9f881d679a7f4775311bc296cb1f5ef0ea59cd11d2c50a33 |