ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilSimpleSAMLphplIdpDiscovery.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2017 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once 'Services/Saml/interfaces/interface.ilSamlIdpDiscovery.php';
5
10{
11 const METADATA_DIRECTORY = 'auth/saml/metadata';
12
16 public function __construct()
17 {
20 $this->instance = 'saml';
21 $this->metadataSets = array('saml20-idp-remote');
22 $this->isPassive = false;
23 }
24
28 public function getMetadataDirectory()
29 {
31 }
32
36 public function getList()
37 {
38 return $this->getIdPList();
39 }
40
45 protected function getMetadataPath($idpId)
46 {
47 return $this->getMetadataDirectory() . '/' . $idpId . '.xml';
48 }
49
53 public function storeIdpMetadata($idpId, $metadata)
54 {
55 global $DIC;
56
57 $fs = $DIC->filesystem()->storage();
58
59 $fs->put($this->getMetadataPath($idpId), $metadata);
60 }
61
65 public function fetchIdpMetadata($idpId)
66 {
67 global $DIC;
68
69 $fs = $DIC->filesystem()->storage();
70
71 if (!$fs->has($this->getMetadataPath($idpId))) {
72 return '';
73 }
74
75 return $fs->read($this->getMetadataPath($idpId));
76 }
77
81 public function deleteIdpMetadata($idpId)
82 {
83 global $DIC;
84
85 $fs = $DIC->filesystem()->storage();
86
87 if ($fs->has($this->getMetadataPath($idpId))) {
88 $fs->delete($this->getMetadataPath($idpId));
89 }
90 }
91}
An exception for terminatinating execution or to throw for unit testing.
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.
static getMetadataHandler()
This function retrieves the current instance of the metadata handler.
getIdPList()
Retrieve the list of IdPs which are stored in the metadata.
Definition: IdPDisco.php:459
Class ilSimpleSAMLphplIdpDiscovery.
__construct()
ilSimpleSAMLphplIdpDiscovery constructor.
getList()
This method should return an array of IDPs.Each element should be an array as well,...
instance(Loop $newLoop=null)
Retrieves or sets the global Loop object.
Definition: functions.php:173
global $DIC
Definition: saml.php:7