diff --git a/app.py b/app.py index 62feab3..06ee84d 100644 --- a/app.py +++ b/app.py @@ -50,14 +50,6 @@ def logout(): app_config.AUTHORITY + "/oauth2/v2.0/logout" + "?post_logout_redirect_uri=" + url_for("index", _external=True)) -# This page is only used in B2C scenario -@app.route("/edit_profile") -def edit_profile(): - app = _build_msal_app(authority=app_config.B2C_PROFILE_AUTHORITY) - return redirect(app.get_authorization_request_url([], - state=str(uuid.uuid4()), - redirect_uri=url_for("authorized", _external=True))) - @app.route("/graphcall") def graphcall(): token = _get_token_from_cache(app_config.SCOPE) diff --git a/app_config_b2c.py b/app_config_b2c.py index 386cd1f..01e1dbc 100644 --- a/app_config_b2c.py +++ b/app_config_b2c.py @@ -3,6 +3,7 @@ b2c_tenant = "fabrikamb2c" signupsignin_user_flow = "b2c_1_signupsignin1" editprofile_user_flow = "b2c_1_profileediting1" +resetpassword_user_flow = "b2c_1_passwordreset1" authority_template = "https://{tenant}.b2clogin.com/{tenant}.onmicrosoft.com/{user_flow}" CLIENT_SECRET = "Enter_the_Client_Secret_Here" # Our Quickstart uses this placeholder @@ -17,6 +18,8 @@ tenant=b2c_tenant, user_flow=signupsignin_user_flow) B2C_PROFILE_AUTHORITY = authority_template.format( tenant=b2c_tenant, user_flow=editprofile_user_flow) +B2C_RESET_PASSWORD_AUTHORITY = authority_template.format( + tenant=b2c_tenant, user_flow=resetpassword_user_flow) CLIENT_ID = "Enter_the_Application_Id_here" diff --git a/templates/index.html b/templates/index.html index ff28ad5..1211594 100644 --- a/templates/index.html +++ b/templates/index.html @@ -12,7 +12,7 @@

Welcome {{ user.get("name") }}!

{% endif %} {% if config.get("B2C_PROFILE_AUTHORITY") %} -
  • Edit Profile
  • +
  • Edit Profile
  • {% endif %}
  • Logout
  • diff --git a/templates/login.html b/templates/login.html index 135d1b9..b3647a7 100644 --- a/templates/login.html +++ b/templates/login.html @@ -8,6 +8,10 @@

    Microsoft Identity Python Web App

  • Sign In
  • + {% if config.get("B2C_RESET_PASSWORD_AUTHORITY") %} +
  • Reset Password
  • + {% endif %} +