Skip to main content
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.

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)

Release files for oauth2-proxy-cookie-256 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for oauth2-proxy-cookie-256 0.1.1
File Size Uploaded
oauth2-proxy-cookie-256-0.1.1.tar.gz 3.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for oauth2-proxy-cookie-256 0.1.1
File Interpreter ABI Platform
oauth2_proxy_cookie_256-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 18.7 kB

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page