Source
if (array_key_exists('use_proxy_headers', $SSO['SETTINGS']) && (bool) $SSO['SETTINGS']['use_proxy_headers']) {
<?php
/*
** Zabbix
** Copyright (C) 2001-2023 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
require_once __DIR__.'/include/config.inc.php';
$redirect_to = (new CUrl('index.php'))->setArgument('form', 'default');
$request = CSessionHelper::get('request');
CSessionHelper::unset(['request']);
if (hasRequest('request')) {
$request = getRequest('request');
preg_match('/^\/?(?<filename>[a-z0-9_.]+\.php)(\?.*)?$/i', $request, $test_request);
if (!array_key_exists('filename', $test_request) || !file_exists('./'.$test_request['filename'])
|| $test_request['filename'] === basename(__FILE__)) {
$request = '';
}
if ($request !== '') {
$redirect_to->setArgument('request', $request);
CSessionHelper::set('request', $request);
}
}
if (CAuthenticationHelper::get(CAuthenticationHelper::SAML_AUTH_ENABLED) == ZBX_AUTH_SAML_DISABLED) {
CSessionHelper::unset(['request']);
redirect($redirect_to->toString());
}
use OneLogin\Saml2\Auth;
use OneLogin\Saml2\Utils;
use SCIM\services\Group as ScimGroup;
global $SSO;
if (!is_array($SSO)) {
$SSO = [];
}
$SSO += ['SETTINGS' => []];
$certs = [
'SP_KEY' => 'conf/certs/sp.key',
'SP_CERT' => 'conf/certs/sp.crt',