Public | Automated Build

Last pushed: 3 days ago
Short Description
A minimal Python implementation of a Portier Relying Party.
Full Description

Portier Relying Party Demo

This is a minimal Python implementation of a Portier Relying Party.
To get started, you need Python 3.4 or newer.

.. code-block:: bash

python3 -m venv ./venv
./venv/bin/pip install -r requirements.txt
./venv/bin/python3 ./


By default, this demo listens on http://localhost:8000 and delegates to the
production Portier Broker_ at This should be
sufficient for local development and testing of this demo.

To override these values, you can either modify the config.ini file (there
is an example in config.ini.dist), or set environment variables.

Environment variables always take precedence over config.ini.

============== ==================== =========================
config.ini Environment Variable Default Value
============== ==================== =========================
ListenPort DEMO_LISTEN_PORT 8000
WebsiteURL DEMO_WEBSITE_URL http://localhost:8000
RedisURL DEMO_REDIS_URL (none - uses FakeRedis)
Secret DEMO_SECRET (none - generates one)
============== ==================== =========================

About Redis

To prevent replay attacks, this demo needs to be able to store and retrieve a
nonce_ for each login attempt. Redis_ is a great choice for this, since all
its operations are atomic and it supports time-based expiration of data.

For production deployments of this demo, you must provide a Redis server via the
RedisURL setting. For local testing, this demo uses FakeRedis_.

Deploying on Heroku

In addition to the environment variables above, this demo will attempt to detect
available metadata when deployed on Heroku.

If $PORT is set, the app will bind to${PORT} by default. This
can be overriden by setting the DEMO_LISTEN_IP and DEMO_LISTEN_PORT
environment variables.

If Dyno Metadata_ is enabled for your application, the WebsiteURL will
default to the hostname https://${HEROKU_APP_NAME} This can
still be overridden by setting the DEMO_WEBSITE_URL environment variable.

If you are using Redis To Go, RedisGreen, RedisCloud, Heroku Redis,
or openredis_ with your deployment, this demo will automatically detect and
default the first provider it finds from that list. This can still be overridden
by setting the DEMO_REDIS_URL environment variable.

.. _Portier Broker:
.. _FakeRedis:
.. _Redis:
.. _nonce:
.. _Dyno Metadata:
.. _Redis To Go:
.. _RedisGreen:
.. _RedisCloud:
.. _Heroku Redis:
.. _openredis:

Docker Pull Command
Source Repository