Skip to content

Commit a170494

Browse files
committed
Make REDIRECT_PATH configurable
1 parent 4863747 commit a170494

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def login():
2727
redirect_uri=url_for("authorized", _external=True))
2828
return "<a href='%s'>Login with Microsoft Identity</a>" % auth_url
2929

30-
@app.route("/getAToken") # Its absolute URL must match your app's redirect_uri set in AAD
30+
@app.route(app_config.REDIRECT_PATH) # Its absolute URL must match your app's redirect_uri set in AAD
3131
def authorized():
3232
if request.args['state'] != session.get("state"):
3333
return redirect(url_for("login"))

app_config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313

1414
CLIENT_ID = "Enter_the_Application_Id_here"
1515

16+
REDIRECT_PATH = "/getAToken" # It will be used to form an absolute URL
17+
# And that absolute URL must match your app's redirect_uri set in AAD
18+
1619
# You can find more Microsoft Graph API endpoints from Graph Explorer
1720
# https://developer.microsoft.com/en-us/graph/graph-explorer
1821
ENDPOINT = 'https://graph.microsoft.com/v1.0/users' # This resource requires no admin consent

0 commit comments

Comments
 (0)