50 if (!is_file(getcwd() .
'/ilias.ini.php')) {
51 die(
'Please ensure ILIAS is installed!');
56 if (isset(
$_GET[
"client_id"])) {
66 require_once
'Services/Context/classes/class.ilContext.php';
69 require_once
'Services/Init/classes/class.ilInitialisation.php';
74 require_once
'Services/Saml/classes/class.ilSamlAuthFactory.php';
80 if (!array_key_exists(
'PATH_INFO',
$_SERVER)) {
82 $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.');
86 if (
$config->getBoolean(
'admin.protectmetadata',
false)) {
95 throw new AuthSource(
$sourceId,
'Could not find authentication source.');
101 'The authentication source is not a SAML Service Provider.' 112 Constants::BINDING_HTTP_REDIRECT,
113 Constants::BINDING_SOAP,
121 foreach (
$slob as $binding) {
122 if ($binding == Constants::BINDING_SOAP && !(
$store instanceof SQL)) {
127 'Binding' => $binding,
128 'Location' =>
$spconfig->getString(
'SingleLogoutServiceLocation',
$slol),
133 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST',
134 'urn:oasis:names:tc:SAML:1.0:profiles:browser-post',
135 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact',
136 'urn:oasis:names:tc:SAML:1.0:profiles:artifact-01',
139 if (
$spconfig->getString(
'ProtocolBinding',
'') ==
'urn:oasis:names:tc:SAML:2.0:profiles:holder-of-key:SSO:browser') {
149 $acsArray = [
'index' =>
$index];
151 case 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST':
152 $acsArray[
'Binding'] = Constants::BINDING_HTTP_POST;
160 case 'urn:oasis:names:tc:SAML:1.0:profiles:browser-post':
161 $acsArray[
'Binding'] =
'urn:oasis:names:tc:SAML:1.0:profiles:browser-post';
169 case 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact':
170 $acsArray[
'Binding'] =
'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact';
178 case 'urn:oasis:names:tc:SAML:1.0:profiles:artifact-01':
179 $acsArray[
'Binding'] =
'urn:oasis:names:tc:SAML:1.0:profiles:artifact-01';
187 case 'urn:oasis:names:tc:SAML:2.0:profiles:holder-of-key:SSO:browser':
188 $acsArray[
'Binding'] =
'urn:oasis:names:tc:SAML:2.0:profiles:holder-of-key:SSO:browser';
192 $acsArray[
'hoksso:ProtocolBinding'] = Constants::BINDING_HTTP_REDIRECT;
212 'type' =>
'X509Certificate',
214 'encryption' =>
true,
215 'X509Certificate' =>
$certInfo[
'certData'],
226 'type' =>
'X509Certificate',
228 'encryption' => ($hasNewCert ? false :
true),
229 'X509Certificate' =>
$certInfo[
'certData'],
240 Constants::NAMEID_TRANSIENT
242 } elseif (is_string(
$format)) {
259 $description =
$spconfig->getArray(
'description', null);
260 if ($description !== null) {
264 $nameFormat =
$spconfig->getString(
'attributes.NameFormat', null);
265 if ($nameFormat !== null) {
269 if (
$spconfig->hasValue(
'attributes.index')) {
273 if (
$spconfig->hasValue(
'attributes.isDefault')) {
283 $metaArray20[
'OrganizationDisplayName'] =
$spconfig->getLocalizedString(
'OrganizationDisplayName', null);
290 throw new \SimpleSAML\Error\Exception(
'If OrganizationName is set, OrganizationURL must also be set.');
295 $contacts =
$spconfig->getArray(
'contacts');
296 foreach ($contacts as $contact) {
297 $metaArray20[
'contacts'][] = Metadata::getContact($contact);
306 'name' =>
$config->getString(
'technicalcontact_name', null),
307 'contactType' =>
'technical' 309 $metaArray20[
'contacts'][] = \SimpleSAML\Utils\Config\Metadata::getContact($techcontact);
313 if (count(
$keys) === 1) {
315 } elseif (count(
$keys) > 1) {
320 if (
$spconfig->hasValue(
'EntityAttributes')) {
330 if (
$spconfig->hasValue(
'RegistrationInfo')) {
335 if (
$spconfig->hasValue(
'WantAssertionsSigned')) {
338 if (
$spconfig->hasValue(
'redirect.sign')) {
340 } elseif (
$spconfig->hasValue(
'sign.authnrequest')) {
363 if (array_key_exists(
'output', $_REQUEST) && $_REQUEST[
'output'] ==
'xhtml') {
366 $t->data[
'clipboard.js'] =
true;
367 $t->data[
'header'] =
'saml20-sp';
368 $t->data[
'headerString'] = Translate::noop(
'metadata_saml20-sp');
369 $t->data[
'metadata'] = htmlspecialchars(
$xml);
370 $t->data[
'metadataflat'] =
'$metadata[' . var_export(
$entityId,
true) .
'] = ' . VarExporter::export(
$metaArray20) .
';';
376 header(
'Content-Type: application/samlmetadata+xml');
379 header(
"Content-Disposition:attachment; filename=\"" .
$ascii_filename .
"\"");
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getASCIIFilename(string $a_filename)
static initILIAS()
ilias initialisation
static init(string $a_type)
Init context by type.