Source
_s('The parameter "%1$s" is missing from the user attributes.', CAuthenticationHelper::get(CAuthenticationHelper::SAML_USERNAME_ATTRIBUTE))
<?php
/*
** Zabbix
** Copyright (C) 2001-2022 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;
global $SSO;
$sp_key = '';
$sp_cert = '';
$idp_cert = '';
if (is_array($SSO) && array_key_exists('SP_KEY', $SSO)) {
if (is_readable($SSO['SP_KEY'])) {
$sp_key = file_get_contents($SSO['SP_KEY']);
}
}