This repository contains an example project that is used to demo the Redis-based session storage for oic
python library.
You can find the session storage source code at https://github.com/alehuo/pyoidc-redis-session-backend
Variables marked with an asterisk (*
) needs to be set manually
FLASK_ENV
- Flask environment. Defaults toproduction
SERVER_ADDRESS
- Server address. Defaults tohttp://localhost
OIDC_SERVER_URL
- OpenID Connect server URL*
OIDC_CLIENT_ID
- OpenID Connect Client ID*
OIDC_CLIENT_SECRET
- OpenID Connect Client secret*
SESSION_SECRET_KEY
- Session secret key. Defaults tounsafe
SESSION_REDIS_HOST
- Redis host. Defaults tohttp://redis
which points to the Redis defined indocker-compose.yml
SESSION_REDIS_POST
- Redis port. Defaults to6379
Before running these steps, make sure you have an OIDC provider that you can use. In this case, I recommend using Auth0 for the OIDC provider.
- Create and activate Python virtual env:
python3 -m venv env
andsource env/bin/activate
- Run
pip install -r requirements.txt
- Set environment variables
- Run
python3 src/app.py
..or run docker-compose up --build
and watch the magic happen. Remember to set the required environment variables.
Contributions to this repo are welcome.
This project has been licensed with MIT license.