Files
kngil_home/kngil/bbs/oidc_config.php
2026-02-02 18:52:20 +09:00

23 lines
719 B
PHP

<?php
// /kngil/bbs/oidc_config.php
require_once __DIR__ . '/env.php';
kngil_load_env_once(dirname(__DIR__, 2) . '/.env');
$issuer = getenv('OIDC_ISSUER') ?: '';
$clientId = getenv('OIDC_CLIENT_ID') ?: '';
$clientSecret = getenv('OIDC_CLIENT_SECRET') ?: '';
$redirectUrl = getenv('OIDC_REDIRECT_URL') ?: '';
$scopesRaw = getenv('OIDC_SCOPES');
$scopes = ['openid'];
if ($scopesRaw !== false && $scopesRaw !== '') {
$scopes = array_values(array_filter(preg_split('/\s*,\s*|\s+/', $scopesRaw)));
}
return [
'issuer' => $issuer, // 예: https://idp.example.com/auth/realms/master
'client_id' => $clientId,
'client_secret' => $clientSecret,
'redirect_url' => $redirectUrl,
'scopes' => $scopes,
];