4chdir(dirname(__FILE__));
 
   18if (!file_exists(getcwd() . 
'/ilias.ini.php')) {
 
   19    die(
'Please ensure ILIAS is installed!');
 
   24if (isset(
$_GET[
"client_id"])) {
 
   34require_once 
'Services/Context/classes/class.ilContext.php';
 
   37require_once 
'Services/Init/classes/class.ilInitialisation.php';
 
   42require_once 
'Services/Saml/classes/class.ilSamlAuthFactory.php';
 
   48if (!array_key_exists(
'PATH_INFO', 
$_SERVER)) {
 
   50    $DIC->logger()->root()->warning(
'Missing "PATH_INFO" variable. This could be a false positive log entry, but you have to ensure a valid "PATH_INFO" setting for your HTTP server.');
 
   54if (
$config->getBoolean(
'admin.protectmetadata', 
false)) {
 
   77    SAML2\Constants::BINDING_HTTP_REDIRECT,
 
   78    SAML2\Constants::BINDING_SOAP,
 
   98    'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST',
 
   99    'urn:oasis:names:tc:SAML:1.0:profiles:browser-post',
 
  100    'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact',
 
  101    'urn:oasis:names:tc:SAML:1.0:profiles:artifact-01',
 
  104if (
$spconfig->getString(
'ProtocolBinding', 
'') == 
'urn:oasis:names:tc:SAML:2.0:profiles:holder-of-key:SSO:browser') {
 
  113    $acsArray = array(
'index' => 
$index);
 
  115        case 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST':
 
  118            $acsArray[
'Location'] = 
$iliasHttpPath . 
"/saml2-acs.php/{$sourceId}/" . CLIENT_ID;
 
  121        case 'urn:oasis:names:tc:SAML:1.0:profiles:browser-post':
 
  122            $acsArray[
'Binding'] = 
'urn:oasis:names:tc:SAML:1.0:profiles:browser-post';
 
  124            $acsArray[
'Location'] = 
$iliasHttpPath . 
"/saml1-acs.php/{$sourceId}/" . CLIENT_ID;
 
  126        case 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact':
 
  127            $acsArray[
'Binding'] = 
'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact';
 
  129            $acsArray[
'Location'] = 
$iliasHttpPath . 
"/saml2-acs.php/{$sourceId}/" . CLIENT_ID;
 
  132        case 'urn:oasis:names:tc:SAML:1.0:profiles:artifact-01':
 
  133            $acsArray[
'Binding'] = 
'urn:oasis:names:tc:SAML:1.0:profiles:artifact-01';
 
  135            $acsArray[
'Location'] = 
$iliasHttpPath . 
"/saml1-acs.php/{$sourceId}/artifact/" . CLIENT_ID;
 
  138        case 'urn:oasis:names:tc:SAML:2.0:profiles:holder-of-key:SSO:browser':
 
  139            $acsArray[
'Binding'] = 
'urn:oasis:names:tc:SAML:2.0:profiles:holder-of-key:SSO:browser';
 
  141            $acsArray[
'Location'] = 
$iliasHttpPath . 
"/saml2-acs.php/{$sourceId}/" . CLIENT_ID;
 
  160        'type' => 
'X509Certificate',
 
  162        'encryption' => 
true,
 
  163        'X509Certificate' => 
$certInfo[
'certData'],
 
  174        'type' => 
'X509Certificate',
 
  176        'encryption' => ($hasNewCert ? 
false : 
true),
 
  177        'X509Certificate' => 
$certInfo[
'certData'],
 
  205    $nameFormat = 
$spconfig->getString(
'attributes.NameFormat', 
null);
 
  206    if ($nameFormat !== 
null) {
 
  216    $metaArray20[
'OrganizationDisplayName'] = 
$spconfig->getLocalizedString(
'OrganizationDisplayName', 
null);
 
  228    $contacts = 
$spconfig->getArray(
'contacts');
 
  229    foreach ($contacts as $contact) {
 
  235$email = 
$config->getString(
'technicalcontact_email', 
'na@example.org', 
false);
 
  237    $techcontact[
'emailAddress'] = 
$email;
 
  238    $techcontact[
'name'] = 
$config->getString(
'technicalcontact_name', 
null);
 
  239    $techcontact[
'contactType'] = 
'technical';
 
  244if (count(
$keys) === 1) {
 
  246} elseif (count(
$keys) > 1) {
 
  251if (
$spconfig->hasValue(
'EntityAttributes')) {
 
  261if (
$spconfig->hasValue(
'RegistrationInfo')) {
 
  266if (
$spconfig->hasValue(
'WantAssertionsSigned')) {
 
  269if (
$spconfig->hasValue(
'redirect.sign')) {
 
  271} elseif (
$spconfig->hasValue(
'sign.authnrequest')) {
 
  298if (array_key_exists(
'output', $_REQUEST) && $_REQUEST[
'output'] == 
'xhtml') {
 
  301    $t->data[
'clipboard.js'] = 
true;
 
  302    $t->data[
'header'] = 
'saml20-sp';
 
  303    $t->data[
'metadata'] = htmlspecialchars(
$xml);
 
  304    $t->data[
'metadataflat'] = 
'$metadata[' . var_export(
$entityId, 
true) . 
'] = ' . var_export(
$metaArray20, 
true) . 
';';
 
  306    $t->data[
'metaurl'] = 
$iliasHttpPath . 
"/metadata.php{$sourceId}/" . CLIENT_ID;
 
  310    header(
'Content-Type: application/samlmetadata+xml');
 
  312    header(
"Content-Disposition:attachment; filename=\"" . 
$ascii_filename . 
"\"");
 
An exception for terminatinating execution or to throw for unit testing.
const BINDING_HTTP_REDIRECT
The URN for the HTTP-Redirect binding.
const BINDING_HTTP_POST
The URN for the HTTP-POST binding.
static getInstance()
Retrieve our singleton instance.
static requireAdmin()
Require admin access to the current page.
static loadPublicKey(\SimpleSAML_Configuration $metadata, $required=false, $prefix='')
Get public key or certificate from metadata.
static getById($authId, $type=null)
Retrieve authentication source.
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.
static init($a_type)
Init context by type.
static initILIAS()
ilias initialisation
static getASCIIFilename($a_filename)
convert utf8 to ascii filename
Attribute-related utility methods.
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']