This document describes how to setup the provided Python code
(in the directory python_skeleton/OIDCRPExample/
).
- Python 2.7 or 3.4.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-get install python-dev python-pip libssl-dev libffi-dev libsasl2-dev
- Setup a virtual environment. (You can do it directly from pyCharm)
- 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). With recent versions of Chrome there seem not to be a problem.
- Specify the path to the root directory containing all necessary files (
-
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.).
- The missing parts are marked with