OAuth Sample Code (Python)
I wrote this Flask code using requests when I was learning about our OAuth, so it might be helpful for your own testing and debugging.
You can run it as a Python process on your local machine, or you can run it in a Docker container.
You can set the program to break at a specific OAuth step by setting the value of debug_step on line 23 to a value in the range [0..3]
Once you have it running, open your browser and point to where it is running. It should immediately redirect you to the August OAuth flow on auth.august.com.
If you haven't used Docker before, and you're running Docker in a VM (like VirtualBox), then reaching the container from the host can be a little complicated.
docker run -d --name myauthtest --env-file <full path to environment file> -p 5000:5000 augustoauth
That runs the container and maps port 5000 on the VM to port 5000 on the container (which is the default Flask port). But your VM still needs to map a port to your host -- in VirtualBox this is controlled through Port Forwarding (unofficial docs).
So, browser --> localhost:port --> vm:port -- > container:port
Docker handles the last two steps for you with the -p argument, but you have to manually set up the localhost:port-->vm:port configuration if you're using a VM. Of course if you're running Docker natively (your machine is a Linux machine) then the container port is a port on your real machine and you don't have to fool with the middle step:
(On a Linux Docker host):
browser --> localhost:port --> container:port
Please leave feedback as replies and I'll fix these notes as best I can.
Here is what happens on my machine when I have localhost:8080 mapped to vm:5000:
Step 0 Set up an August Credentials file
Read the Readme.md for details, and create a text file (or export environment variables) with your own OAuth information in it. The credentials enter the software through environment variables.
Step 0.1 Configure VM Port Forwarding
Since my Docker is running in a VM then I need to forward ports from the host to the VM.
Step 0.2 Start the Docker Container
docker run -d --name myauthtest --env-file <full path to environment file> -p 5000:5000 augustoauth
Step 0.3 Browse to the Container
I enter the localhost:port address into my browser.
Step 1 Authenticate with August
As soon as I press "Enter" on the URL, the browser goes to the container and then gets redirected to oauth.august.com where I log in with email address, password and then PIN code via SMS.
Step 1.1 Agree to Access
The logo will be different for you -- it should be the icon you shared with us, or the August logo if you didn't give us an icon.
Note
August will only redirect back to a URL you've whitelisted with us at the
time when you got your client_id and x-august-api-key from us.
(This step is actually invisible because the container immediately takes the code and contacts oauth.august.com for an auth token, and makes a call to get your profile (next screen shot)
Step 3 Exchange Code for Access Token
(This step is invisible too, but the visible effect is that we can show your profile)