ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilSimpleSAMLphplIdpDiscovery.php
Go to the documentation of this file.
1<?php declare(strict_types=1);
2/* Copyright (c) 1998-2017 ILIAS open source, Extended GPL, see docs/LICENSE */
3
7class ilSimpleSAMLphplIdpDiscovery extends SimpleSAML\XHTML\IdPDisco implements ilSamlIdpDiscovery
8{
9 const METADATA_DIRECTORY = 'auth/saml/metadata';
10
14 public function __construct()
15 {
16 $this->config = SimpleSAML\Configuration::getInstance();
17 $this->metadata = SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler();
18 $this->instance = 'saml';
19 $this->metadataSets = ['saml20-idp-remote'];
20 $this->isPassive = false;
21 }
22
26 public function getMetadataDirectory() : string
27 {
29 }
30
34 public function getList() : array
35 {
36 return $this->getIdPList();
37 }
38
43 private function getMetadataPath(int $idpId) : string
44 {
45 return $this->getMetadataDirectory() . '/' . $idpId . '.xml';
46 }
47
51 public function storeIdpMetadata(int $idpId, string $metadata) : void
52 {
53 global $DIC;
54
55 $fs = $DIC->filesystem()->storage();
56
57 $fs->put($this->getMetadataPath($idpId), $metadata);
58 }
59
63 public function fetchIdpMetadata(int $idpId) : string
64 {
65 global $DIC;
66
67 $fs = $DIC->filesystem()->storage();
68
69 if (!$fs->has($this->getMetadataPath($idpId))) {
70 return '';
71 }
72
73 return $fs->read($this->getMetadataPath($idpId));
74 }
75
79 public function deleteIdpMetadata(int $idpId) : void
80 {
81 global $DIC;
82
83 $fs = $DIC->filesystem()->storage();
84
85 if ($fs->has($this->getMetadataPath($idpId))) {
86 $fs->delete($this->getMetadataPath($idpId));
87 }
88 }
89}
An exception for terminatinating execution or to throw for unit testing.
Class ilSimpleSAMLphplIdpDiscovery.
storeIdpMetadata(int $idpId, string $metadata)
__construct()
ilSimpleSAMLphplIdpDiscovery constructor.
getList()
This method should return an array of IDPs.Each element should be an array as well,...
global $DIC
Definition: goto.php:24