Skip to content

Files

Latest commit

 

History

History

python-flask-starter-with-oauth

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

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. Create a new Miro App and make sure to check the box for Expire user authorization token as shown in the screenshot below.

    ⚠️ If you don't check this box, the app will not work! ⚠️

image

  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 and then click save:

# See https://developers.miro.com/docs/app-manifest on how to use this
appName: Python Flask Starter with OAuth
sdkVersion: SDK_V2
sdkUri: http://127.0.0.1:5000
redirectUris: http://127.0.0.1:5000/callback
scopes:
  - boards:read
  - boards:write
  1. Run the app with python3 app.py
  2. 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.