This app shows how to implement the OAuth2.0 flow and call the Miro REST API's Create Board endpoint, using Flask / Python.
flask_python_starter_with_oauth_demo.mov
- Included Features
- Tools and Technologies
- Prerequisites
- Run the app locally
- Folder Structure
- Contributing
- License
- You have a Miro account.
- You're signed in to Miro.
- Your Miro account has a Developer team.
- Your development environment includes Node.js 14.13 or a later version.
- You have the latest versions of Flask and Python installed.
-
Install the project dependenciesAwes by running
pip3 install -r requirements.txt
-
Create your
.env
file by copying the template, and use it to store your credentials:cp sample.env .env
-
In your account profile, go to Your apps, and then select the app you just created to access its settings page.
On the app settings page:- Go to App Credentials, and copy the app Client ID and Client secret values.
- Paste these details to your
.env
file'sclientID
andclientSecret
variables.
-
From your App Settings page, open the app manifest editor by clicking Edit in Manifest.
In the app manifest editor, configure the app as follows:redirectUris
: assignhttp://127.0.0.1:5000/callback
as a value for this property.
It defines the redirect URL that starts the OAuth 2.0 code grant flow for the REST API.scopes
: add the permission scopes that users need to grant the app when they install it.
To enable the app to read from and write to the board, add the following permissions:boards:read
boards:write
Hit Save.
-
Run the app with
python3 app.py
-
Open the page at
http://127.0.0.1:5000
.
├── templates
│ └── index.html <-- The html view for users who have not yet authorized Miro
│ └── loggedin.html <-- The html view for users who have authorized Miro
│
├── app.py <-- The python script. This script runs Miro's OAuth flow and calls the Miro REST API.
├── sample.env <-- Sample .env file to show format of environment variables
└── requirements.txt <-- The python requirements file
If you want to contribute to this example, or any other Miro Open Source project, please review Miro's contributing guide.