Miro Flask Python Starter with OAuth

This app shows how to implement the OAuth2.0 flow and call the Miro REST API's Create Board endpoint, using Flask / Python.

👨🏻‍💻 App Demo

flask_python_starter_with_oauth_demo.mov

📒 Table of Contents

⚙️ Included Features

🛠️ Tools and Technologies

✅ Prerequisites

🏃🏽‍♂️ Run the app locally

  1. Install the project dependenciesAwes by running pip3 install -r requirements.txt

  2. Create your .env file by copying the template, and use it to store your credentials:

    cp sample.env .env
    
  3. 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's clientID and clientSecret variables.
  4. 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: assign http://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.
  5. Run the app with python3 app.py

  6. Open the page at http://127.0.0.1:5000

🗂️ Folder structure

.
├── 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

🫱🏻‍🫲🏽 Contributing

If you want to contribute to this example, or any other Miro Open Source project, please review Miro's contributing guide.

🪪 License

MIT License.