solventum-image-metadata/src
SamoilenkoVadym e9784d7da8 Phase 4 Complete: Authentication, Database, and Microsoft SSO
This commit implements a complete authentication system with local users,
session management, and Microsoft SSO support for enterprise environments.

New Files Created:
- src/database.py: SQLite database management with users, sessions, audit_log
- src/auth.py: Authentication module with login, SSO, and session management
- templates/login.html: Modern login page with SSO button

Database Schema:
- users table: username, password_hash, email, full_name, auth_method
- sessions table: session management with expiration
- audit_log table: user activity tracking
- Indexes for performance optimization

Authentication Features:
- Local authentication with test user (tester/oliveradmin)
- Password hashing with Werkzeug
- Session management with 24-hour expiration
- @login_required decorator for route protection
- Automatic session cleanup

Microsoft SSO Integration:
- MSAL library integration for Azure AD
- OAuth2 authorization code flow
- Microsoft Graph API user info retrieval
- Automatic user creation/update from SSO
- CSRF protection with state parameter
- Graceful fallback when SSO not configured

Security Improvements:
- All routes protected with @login_required
- Session-based authentication with database storage
- IP address and user agent logging
- Audit trail for user actions
- Secure session token generation

Configuration:
- Environment variables for Azure AD (AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, AZURE_TENANT_ID)
- SECRET_KEY for Flask session encryption
- Optional MSAL dependency (SSO works only if configured)

Dependencies Added:
- Werkzeug>=3.0.0 for password hashing
- msal>=1.20.0 for Microsoft SSO (optional)

Test Credentials:
- Username: tester
- Password: oliveradmin

Phase 4 Status: Complete
Next Phase: Phase 5 (Modern UI Overhaul) for v3.1 release

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-25 15:57:47 +00:00
..
extractors Phase 1.4: ExifTool integration for enhanced metadata support 2026-01-25 15:26:01 +00:00
updaters Phase 1.4: ExifTool integration for enhanced metadata support 2026-01-25 15:26:01 +00:00
__init__.py Initial commit: Universal metadata tool with Excel-based lookup 2026-01-25 14:23:42 +00:00
auth.py Phase 4 Complete: Authentication, Database, and Microsoft SSO 2026-01-25 15:57:47 +00:00
base_extractor.py Initial commit: Universal metadata tool with Excel-based lookup 2026-01-25 14:23:42 +00:00
base_updater.py Initial commit: Universal metadata tool with Excel-based lookup 2026-01-25 14:23:42 +00:00
config.py Phase 1.1: Rebrand to Oliver Metadata Tool v3.0 2026-01-25 15:15:26 +00:00
database.py Phase 4 Complete: Authentication, Database, and Microsoft SSO 2026-01-25 15:57:47 +00:00
excel_metadata_lookup.py Initial commit: Universal metadata tool with Excel-based lookup 2026-01-25 14:23:42 +00:00
field_mapper.py Phase 3.1: Field mapping foundation with auto-detection 2026-01-25 15:45:11 +00:00
file_detector.py Initial commit: Universal metadata tool with Excel-based lookup 2026-01-25 14:23:42 +00:00
gui_app.py Initial commit: Universal metadata tool with Excel-based lookup 2026-01-25 14:23:42 +00:00
main.py Initial commit: Universal metadata tool with Excel-based lookup 2026-01-25 14:23:42 +00:00
metadata_analyzer.py Phase 2.3: AI metadata generation with production-ready features 2026-01-25 15:36:48 +00:00
metadata_importer.py Phase 3.1: Field mapping foundation with auto-detection 2026-01-25 15:45:11 +00:00
template_manager.py Phase 3 Complete: Batch Selection, CSV Export, and Metadata Templates 2026-01-25 15:52:05 +00:00
utils.py Initial commit: Universal metadata tool with Excel-based lookup 2026-01-25 14:23:42 +00:00