Metadata-Version: 2.1
Name: oauth2-proxy-cookie-256
Version: 0.1.1
Summary: oauth2_proxy/oauth2-proxy compatible library to decode and validate authenticated cookie. compatible with cookie signed at sha256.Forked from isra17/oauth2-proxy-cookie.
Home-page: https://github.com/cyrillecazenavesoroco/oauth2-proxy-cookie
Author: isra17
Author-email: isra017@gmail.com
License: LGPLv3+
Keywords: oauth2-proxy authentication
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3
Requires-Dist: six
Requires-Dist: flask

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

Support library to be used with `bitly/oauth2_proxy
<https://github.com/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
<https://github.com/bitly/oauth2_proxy/blob/master/cookie/cookies.go>`_.

Forked from https://github.com/isra17/oauth2-proxy-cookie to modify sign from sha1 to sha256.

Example
=======

.. code:: python

  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:

.. code:: python

  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)


