I have a flask rest api and currently it has no authentication. I want to learn and try azure active directory authentication with my flask api. I don't have much experience with azure active directory and I have looked some documentation from microsoft https://docs.microsoft.com/en-us/azure/active-directory/develop/v1-protocols-oauth-code. I have registered my app in azure active directory. I have azure tenant id, client id. But I am confused and lost on how do I use those keys in my flask rest api. In the below, if i want my function "index" should be authenticated and this app is registered in azure active directory. To make it work, what should I do next ? Any suggestions and advice would be great.
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return "Hello, World!"
if __name__ == '__main__':
app.run(debug=True)