项目作者: mattlisiv

项目描述 :
Clover OAuth2 Workflow in Python
高级语言: Python
项目地址: git://github.com/mattlisiv/clover-oauth2-python.git
创建时间: 2018-01-14T04:03:40Z
项目社区:https://github.com/mattlisiv/clover-oauth2-python

开源协议:

下载


Clover OAuth2 Workflow

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.

Requirements

  • Docker or pip (Python’s package manager)

Setup

Docker

Build the container from the Dockerfile

  1. 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.

  1. docker run -p 8080:8080 -e application_id='XXXXXXXXXX' -e application_secretion='XXXXXXXXXX' -t clover-auth
pip

Install bottle using pip:

  1. pip install bottle

Then, set your application_id and application_secret:

  1. os.environ["application_id"] = "XXXXXXX"
  2. os.environ["application_secret"] = "XXXXXXX"

Run the HTTP server

  1. python src/oauth-flow.py

Usage

Navigate to your localhost .

You will see a hyperlink to begin the OAuth2 workflow.