Skip to content

Conversation

@vivche
Copy link

@vivche vivche commented Dec 19, 2025

Changes Summary

  • Resolved Azure AD authentication redirect URI issues during local Docker development.
  • Added a banner text color picker to improve contrast and accessibility.
  1. Issue Description
    When running the application locally in Docker, Azure AD authentication failed with the following error:
    AADSTS50011: The redirect URI https://localhost:8000/getAToken does not match the redirect URIs configured for the application.

Although the LOGIN_REDIRECT_URL environment variable was set to use HTTP for local development, the application continued to generate HTTPS redirect URIs.

Root Cause:
In route_frontend_authentication.py, the redirect URI was hardcoded to use HTTPS by passing _scheme='https' to Flask’s url_for() function. This logic ignored the LOGIN_REDIRECT_URL environment variable when Azure Front Door was disabled, resulting in a mismatch during local authentication.

  1. Banner Text Color Picker Enhancement
    Introduced a text color picker alongside the existing banner background color picker. This allows administrators to define custom text colors for the classification banner, ensuring sufficient contrast and improved readability—especially when dark background colors are used.

@vivche
Copy link
Author

vivche commented Dec 19, 2025 via email

@vivche
Copy link
Author

vivche commented Dec 19, 2025 via email

@paullizer
Copy link
Contributor

Reviewing now, thank you Vivien!

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request addresses two main improvements: fixing Azure AD authentication for local Docker development and adding a banner text color picker for better accessibility.

  • Fixed HTTP authentication redirect URI issues by respecting the LOGIN_REDIRECT_URL environment variable instead of hardcoding HTTPS
  • Added a text color picker for classification banners to improve contrast and accessibility
  • Updated Dockerfile from Chainguard to standard Python 3.12-slim with necessary build dependencies
  • Enhanced devcontainer configuration with port forwarding and environment variables

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
docs/fixes/LOCAL_DEVELOPMENT_HTTP_AUTHENTICATION_FIX.md Documentation for authentication fix and banner color feature with setup instructions
application/single_app/route_frontend_authentication.py Fixed redirect URI logic to use LOGIN_REDIRECT_URL when Front Door is disabled; added login activity logging attempt
application/single_app/templates/base.html Updated classification banner to use configurable text color setting
application/single_app/templates/admin_settings.html Added text color picker input, updated preview display, and JavaScript to handle text color changes
application/single_app/route_frontend_admin_settings.py Added backend support for banner text color with default value, form extraction, and settings persistence
application/single_app/Dockerfile Switched from Chainguard to Python 3.12-slim base image, added build dependencies for scientific packages
.devcontainer/devcontainer.json Fixed JSON syntax error, added port forwarding for Flask app, configured Python settings and environment variables
pip.conf Empty configuration file added at repository root

@vivche vivche force-pushed the add-banner-text-color-picker branch from 652f890 to 6367642 Compare December 19, 2025 20:43
- Add color picker for classification banner text color in admin settings
- Default banner text color to white (#ffffff)
- Update banner display to use configurable text color
- Fix HTTP authentication redirect URL for local development
- Fix logging to use current_app.logger instead of non-existent module
@vivche vivche force-pushed the add-banner-text-color-picker branch from 44e9622 to e30f78e Compare December 19, 2025 21:51
- Update version from 0.229.098 to 0.229.099
- Add functional test for banner text color picker feature
- Add functional test for HTTP authentication redirect URL fix

Per coding guidelines 1000005 and 1000006
@vivche vivche force-pushed the add-banner-text-color-picker branch from b3e8815 to f6556f1 Compare December 19, 2025 22:58
@vivche vivche changed the base branch from main to Development December 23, 2025 13:55
@vivche vivche changed the base branch from Development to main December 23, 2025 13:57
@paullizer
Copy link
Contributor

Walked through using FLASK_DEBUG="1" in local .env which will run the application in local mode and support adhoc ssl certs

if debug_mode:
# Local development with HTTPS
# use_reloader=False prevents too_many_retries errors with static files
# Disable excessive logging for static file requests in development
werkzeug_logger = logging.getLogger('werkzeug')
werkzeug_logger.setLevel(logging.ERROR)
app.run(host="0.0.0.0", port=5000, debug=True, ssl_context='adhoc', threaded=True, use_reloader=False)
else:
# Production
port = int(os.environ.get("PORT", 5000))
app.run(host="0.0.0.0", port=port, debug=False)

@paullizer paullizer closed this Dec 23, 2025
@vivche
Copy link
Author

vivche commented Dec 23, 2025 via email

@vivche
Copy link
Author

vivche commented Dec 23, 2025 via email

@vivche
Copy link
Author

vivche commented Dec 23, 2025 via email

@vivche
Copy link
Author

vivche commented Dec 23, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants