This example sets up a basic Python API server with Flask. It uses
Flask-OAuthLib to authenticate the consumer on it's first request via
identitypreview.ses.nsw.gov.au. It then proxies a request to
https://apipreviewbeacon.ses.nsw.gov.au/Api/v1/Users which presents the JSON
blob that contains the user's record in Beacon.
- Pre-requisites
First, install a modern Python and virtualenv. On macOS:
brew install python3
pip install virtualenv-
Clone repo
-
Install
cd ses-auth-shell/server
virtualenv venv
venv/bin/pip install Flask
venv/bin/pip install Flask-OAuthLib- Run
APP_ID='myappid' APP_SECRET='mysecret' venv/bin/python3 app.py- Access API with browser http://localhost:5000/
MIT