This document describes how to setup the provided Python code
(in the directory python_skeleton/OIDCRPExample/
).
- Python 2.7 or 3.*
- Homebrew if using Mac
- PyCharm Community Edition: https://www.jetbrains.com/pycharm/download/ (optional)
On Mac:
-
Install pip: https://pip.pypa.io/en/stable/installing/
-
Install libffi:
brew install libffi
On CentOS:
yum install libffi-devel
On Ubuntu:
apt install python-dev python-pip libssl-dev libffi-dev libsasl2-dev
- Setup a virtual environment.
- Activate the new virtual environment.
-
Install the dependencies:
pip install -r requirements.txt
-
Test that the project runs:
-
Specify the path to the root directory containing all necessary files (
client.json
,index.html
, etc.) inClient.ROOT_PATH
(inoidc_rp/client.py
). -
Run the Relying Party (RP):
python runner.py
(from theOIDCRPExample/
directory). -
Verify the RP is running at http://localhost:8090 using Firefox (Google Chrome has some issues with CherryPy's sessions).
-
Start adding to the skeleton code:
-
The missing parts are marked with
TODO
inoidc_rp/client.py
. -
Read the Python Cookbook for more information about how to use the pyOIDC OpenID Connect library.
-
Make sure to delete cookies and cached data in the browser while testing to avoid strange results (e.g. due to the browser caching redirects, etc.).