This is a simple example of how to authenticate against the Clover OAuth2 sandbox and retrieve an access token.
The setup is a simple Bottle web server that connects to the Clover sandbox.
- Docker or pip (Python's package manager)
Build the container from the Dockerfile
docker build -t clover-auth .
Run the container. Expose the HTTP port and define the environment variables. Replace the application_id and application_secret with your dev credentials.
docker run -p 8080:8080 -e application_id='XXXXXXXXXX' -e application_secretion='XXXXXXXXXX' -t clover-auth
Install bottle using pip:
pip install bottle
Then, set your application_id and application_secret:
os.environ["application_id"] = "XXXXXXX"
os.environ["application_secret"] = "XXXXXXX"
Run the HTTP server
python src/oauth-flow.py
Navigate to your localhost .
You will see a hyperlink to begin the OAuth2 workflow.