Skip to main content

bitly/oauth2-proxy compatible library to decode and validate authenticated cookie.

Project description

https://circleci.com/gh/isra17/oauth2-proxy-cookie.svg?style=svg

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for oauth2-proxy-cookie, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size oauth2-proxy-cookie-0.1.0.tar.gz (2.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page