<?php

/**
 * Configuración de Keycloak
 */
return [
    'url' => $_ENV['KEYCLOAK_URL'] ?? 'https://keycloak.dev-coresoft.com',
    'realm' => $_ENV['KEYCLOAK_REALM'] ?? 'uai',
    'client_id' => $_ENV['KEYCLOAK_CLIENT_ID'] ?? 'app-sigpa-php',
    'client_secret' => $_ENV['KEYCLOAK_CLIENT_SECRET'] ?? '',
    
    // URLs de Keycloak
    'auth_url' => ($_ENV['KEYCLOAK_URL'] ?? 'https://keycloak.dev-coresoft.com') . '/realms/' . ($_ENV['KEYCLOAK_REALM'] ?? 'uai') . '/protocol/openid-connect/auth',
    'token_url' => ($_ENV['KEYCLOAK_URL'] ?? 'https://keycloak.dev-coresoft.com') . '/realms/' . ($_ENV['KEYCLOAK_REALM'] ?? 'uai') . '/protocol/openid-connect/token',
    'userinfo_url' => ($_ENV['KEYCLOAK_URL'] ?? 'https://keycloak.dev-coresoft.com') . '/realms/' . ($_ENV['KEYCLOAK_REALM'] ?? 'uai') . '/protocol/openid-connect/userinfo',
    'logout_url' => ($_ENV['KEYCLOAK_URL'] ?? 'https://keycloak.dev-coresoft.com') . '/realms/' . ($_ENV['KEYCLOAK_REALM'] ?? 'uai') . '/protocol/openid-connect/logout',
    
    // Configuración OAuth2
    'redirect_uri' => ($_ENV['APP_URL'] ?? 'http://localhost') . '/auth/callback',
    'scopes' => ['openid', 'profile', 'email'],
];