- Integrated MSAL authentication for web pages - Added AuthMiddleware.php for SSO orchestration - Added JWTValidator.php for token validation - Protected report.php and webhook_caller.php - Firebase PHP-JWT for token verification - SSO can be disabled for local development - Complete SSO setup documentation - Environment-based configuration
30 lines
880 B
PHP
30 lines
880 B
PHP
<?php
|
|
/**
|
|
* Configuration file for VEO3 Usage Report System
|
|
*/
|
|
|
|
// Load environment variables from .env file
|
|
if (file_exists(__DIR__ . '/env_loader.php')) {
|
|
require_once __DIR__ . '/env_loader.php';
|
|
}
|
|
|
|
// MSAL / Azure AD SSO Configuration
|
|
// Set SSO_ENABLED to false for local development, true for production with SSO
|
|
if (!defined('SSO_ENABLED')) {
|
|
define('SSO_ENABLED', getenv('SSO_ENABLED') === 'true');
|
|
}
|
|
if (!defined('SSO_TENANT_ID')) {
|
|
define('SSO_TENANT_ID', getenv('SSO_TENANT_ID') ?: '');
|
|
}
|
|
if (!defined('SSO_CLIENT_ID')) {
|
|
define('SSO_CLIENT_ID', getenv('SSO_CLIENT_ID') ?: '');
|
|
}
|
|
|
|
// Session configuration
|
|
ini_set('session.gc_maxlifetime', 3600); // 1 hour
|
|
ini_set('session.cookie_lifetime', 3600);
|
|
|
|
// Error reporting (set to 0 in production)
|
|
error_reporting(E_ALL);
|
|
ini_set('display_errors', 0); // Disabled for production
|
|
ini_set('log_errors', 1);
|