ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
SAMLBuilder.php
Go to the documentation of this file.
1 <?php
2 
3 
12 {
13 
14 
21 
22 
28  private $maxCache = null;
29 
30 
36  private $maxDuration = null;
37 
38 
47  public function __construct($entityId, $maxCache = null, $maxDuration = null)
48  {
49  assert(is_string($entityId));
50 
51  $this->maxCache = $maxCache;
52  $this->maxDuration = $maxDuration;
53 
54  $this->entityDescriptor = new \SAML2\XML\md\EntityDescriptor();
55  $this->entityDescriptor->entityID = $entityId;
56  }
57 
58 
59  private function setExpiration($metadata)
60  {
61  if (array_key_exists('expire', $metadata)) {
62  if ($metadata['expire'] - time() < $this->maxDuration) {
63  $this->maxDuration = $metadata['expire'] - time();
64  }
65  }
66 
67  if ($this->maxCache !== null) {
68  $this->entityDescriptor->cacheDuration = 'PT'.$this->maxCache.'S';
69  }
70  if ($this->maxDuration !== null) {
71  $this->entityDescriptor->validUntil = time() + $this->maxDuration;
72  }
73  }
74 
75 
81  public function getEntityDescriptor()
82  {
83  $xml = $this->entityDescriptor->toXML();
84  $xml->ownerDocument->appendChild($xml);
85 
86  return $xml;
87  }
88 
89 
99  public function getEntityDescriptorText($formatted = true)
100  {
101  assert(is_bool($formatted));
102 
103  $xml = $this->getEntityDescriptor();
104  if ($formatted) {
105  SimpleSAML\Utils\XML::formatDOMElement($xml);
106  }
107 
108  return $xml->ownerDocument->saveXML();
109  }
110 
111 
118  {
119  assert(is_array($metadata));
120  assert(isset($metadata['entityid']));
121  assert(isset($metadata['metadata-set']));
122 
124  $defaultEndpoint = $metadata->getDefaultEndpoint('SingleSignOnService');
126  $e->Location = $defaultEndpoint['Location'];
127 
128  $this->addCertificate($e, $metadata);
129 
130  $this->entityDescriptor->RoleDescriptor[] = $e;
131  }
132 
133 
140  private function addExtensions(SimpleSAML_Configuration $metadata, \SAML2\XML\md\RoleDescriptor $e)
141  {
142  if ($metadata->hasValue('tags')) {
143  $a = new \SAML2\XML\saml\Attribute();
144  $a->Name = 'tags';
145  foreach ($metadata->getArray('tags') as $tag) {
146  $a->AttributeValue[] = new \SAML2\XML\saml\AttributeValue($tag);
147  }
148  $e->Extensions[] = $a;
149  }
150 
151  if ($metadata->hasValue('hint.cidr')) {
152  $a = new \SAML2\XML\saml\Attribute();
153  $a->Name = 'hint.cidr';
154  foreach ($metadata->getArray('hint.cidr') as $hint) {
155  $a->AttributeValue[] = new \SAML2\XML\saml\AttributeValue($hint);
156  }
157  $e->Extensions[] = $a;
158  }
159 
160  if ($metadata->hasValue('scope')) {
161  foreach ($metadata->getArray('scope') as $scopetext) {
162  $s = new \SAML2\XML\shibmd\Scope();
163  $s->scope = $scopetext;
164  // Check whether $ ^ ( ) * | \ are in a scope -> assume regex.
165  if (1 === preg_match('/[\$\^\)\(\*\|\\\\]/', $scopetext)) {
166  $s->regexp = true;
167  } else {
168  $s->regexp = false;
169  }
170  $e->Extensions[] = $s;
171  }
172  }
173 
174  if ($metadata->hasValue('EntityAttributes')) {
175  $ea = new \SAML2\XML\mdattr\EntityAttributes();
176  foreach ($metadata->getArray('EntityAttributes') as $attributeName => $attributeValues) {
177  $a = new \SAML2\XML\saml\Attribute();
178  $a->Name = $attributeName;
179  $a->NameFormat = 'urn:oasis:names:tc:SAML:2.0:attrname-format:uri';
180 
181  // Attribute names that is not URI is prefixed as this: '{nameformat}name'
182  if (preg_match('/^\{(.*?)\}(.*)$/', $attributeName, $matches)) {
183  $a->Name = $matches[2];
184  $nameFormat = $matches[1];
185  if ($nameFormat !== \SAML2\Constants::NAMEFORMAT_UNSPECIFIED) {
186  $a->NameFormat = $nameFormat;
187  }
188  }
189  foreach ($attributeValues as $attributeValue) {
190  $a->AttributeValue[] = new \SAML2\XML\saml\AttributeValue($attributeValue);
191  }
192  $ea->children[] = $a;
193  }
194  $this->entityDescriptor->Extensions[] = $ea;
195  }
196 
197  if ($metadata->hasValue('RegistrationInfo')) {
198  $ri = new \SAML2\XML\mdrpi\RegistrationInfo();
199  foreach ($metadata->getArray('RegistrationInfo') as $riName => $riValues) {
200  switch ($riName) {
201  case 'authority':
202  $ri->registrationAuthority = $riValues;
203  break;
204  case 'instant':
205  $ri->registrationInstant = \SAML2\Utils::xsDateTimeToTimestamp($riValues);
206  break;
207  case 'policies':
208  $ri->RegistrationPolicy = $riValues;
209  break;
210  }
211  }
212  $this->entityDescriptor->Extensions[] = $ri;
213  }
214 
215  if ($metadata->hasValue('UIInfo')) {
216  $ui = new \SAML2\XML\mdui\UIInfo();
217  foreach ($metadata->getArray('UIInfo') as $uiName => $uiValues) {
218  switch ($uiName) {
219  case 'DisplayName':
220  $ui->DisplayName = $uiValues;
221  break;
222  case 'Description':
223  $ui->Description = $uiValues;
224  break;
225  case 'InformationURL':
226  $ui->InformationURL = $uiValues;
227  break;
228  case 'PrivacyStatementURL':
229  $ui->PrivacyStatementURL = $uiValues;
230  break;
231  case 'Keywords':
232  foreach ($uiValues as $lang => $keywords) {
233  $uiItem = new \SAML2\XML\mdui\Keywords();
234  $uiItem->lang = $lang;
235  $uiItem->Keywords = $keywords;
236  $ui->Keywords[] = $uiItem;
237  }
238  break;
239  case 'Logo':
240  foreach ($uiValues as $logo) {
241  $uiItem = new \SAML2\XML\mdui\Logo();
242  $uiItem->url = $logo['url'];
243  $uiItem->width = $logo['width'];
244  $uiItem->height = $logo['height'];
245  if (isset($logo['lang'])) {
246  $uiItem->lang = $logo['lang'];
247  }
248  $ui->Logo[] = $uiItem;
249  }
250  break;
251  }
252  }
253  $e->Extensions[] = $ui;
254  }
255 
256  if ($metadata->hasValue('DiscoHints')) {
257  $dh = new \SAML2\XML\mdui\DiscoHints();
258  foreach ($metadata->getArray('DiscoHints') as $dhName => $dhValues) {
259  switch ($dhName) {
260  case 'IPHint':
261  $dh->IPHint = $dhValues;
262  break;
263  case 'DomainHint':
264  $dh->DomainHint = $dhValues;
265  break;
266  case 'GeolocationHint':
267  $dh->GeolocationHint = $dhValues;
268  break;
269  }
270  }
271  $e->Extensions[] = $dh;
272  }
273  }
274 
275 
283  public function addOrganization(array $orgName, array $orgDisplayName, array $orgURL)
284  {
285  $org = new \SAML2\XML\md\Organization();
286 
287  $org->OrganizationName = $orgName;
288  $org->OrganizationDisplayName = $orgDisplayName;
289  $org->OrganizationURL = $orgURL;
290 
291  $this->entityDescriptor->Organization = $org;
292  }
293 
294 
300  public function addOrganizationInfo(array $metadata)
301  {
302  if (empty($metadata['OrganizationName']) ||
303  empty($metadata['OrganizationDisplayName']) ||
304  empty($metadata['OrganizationURL'])
305  ) {
306  // empty or incomplete organization information
307  return;
308  }
309 
310  $orgName = SimpleSAML\Utils\Arrays::arrayize($metadata['OrganizationName'], 'en');
311  $orgDisplayName = SimpleSAML\Utils\Arrays::arrayize($metadata['OrganizationDisplayName'], 'en');
312  $orgURL = SimpleSAML\Utils\Arrays::arrayize($metadata['OrganizationURL'], 'en');
313 
314  $this->addOrganization($orgName, $orgDisplayName, $orgURL);
315  }
316 
317 
326  private static function createEndpoints(array $endpoints, $indexed)
327  {
328  assert(is_bool($indexed));
329 
330  $ret = array();
331 
332  foreach ($endpoints as &$ep) {
333  if ($indexed) {
334  $t = new \SAML2\XML\md\IndexedEndpointType();
335  } else {
336  $t = new \SAML2\XML\md\EndpointType();
337  }
338 
339  $t->Binding = $ep['Binding'];
340  $t->Location = $ep['Location'];
341  if (isset($ep['ResponseLocation'])) {
342  $t->ResponseLocation = $ep['ResponseLocation'];
343  }
344  if (isset($ep['hoksso:ProtocolBinding'])) {
345  $t->setAttributeNS(
346  \SAML2\Constants::NS_HOK,
347  'hoksso:ProtocolBinding',
348  \SAML2\Constants::BINDING_HTTP_REDIRECT
349  );
350  }
351 
352  if ($indexed) {
353  if (!isset($ep['index'])) {
354  // Find the maximum index
355  $maxIndex = -1;
356  foreach ($endpoints as $ep) {
357  if (!isset($ep['index'])) {
358  continue;
359  }
360 
361  if ($ep['index'] > $maxIndex) {
362  $maxIndex = $ep['index'];
363  }
364  }
365 
366  $ep['index'] = $maxIndex + 1;
367  }
368 
369  $t->index = $ep['index'];
370  }
371 
372  $ret[] = $t;
373  }
374 
375  return $ret;
376  }
377 
378 
386  \SAML2\XML\md\SPSSODescriptor $spDesc,
388  ) {
389  $attributes = $metadata->getArray('attributes', array());
390  $name = $metadata->getLocalizedString('name', null);
391 
392  if ($name === null || count($attributes) == 0) {
393  // we cannot add an AttributeConsumingService without name and attributes
394  return;
395  }
396 
397  $attributesrequired = $metadata->getArray('attributes.required', array());
398 
399  /*
400  * Add an AttributeConsumingService element with information as name and description and list
401  * of requested attributes
402  */
403  $attributeconsumer = new \SAML2\XML\md\AttributeConsumingService();
404 
405  $attributeconsumer->index = $metadata->getInteger('attributes.index', 0);
406 
407  if ($metadata->hasValue('attributes.isDefault')) {
408  $attributeconsumer->isDefault = $metadata->getBoolean('attributes.isDefault', false);
409  }
410 
411  $attributeconsumer->ServiceName = $name;
412  $attributeconsumer->ServiceDescription = $metadata->getLocalizedString('description', array());
413 
414  $nameFormat = $metadata->getString('attributes.NameFormat', \SAML2\Constants::NAMEFORMAT_UNSPECIFIED);
415  foreach ($attributes as $friendlyName => $attribute) {
416  $t = new \SAML2\XML\md\RequestedAttribute();
417  $t->Name = $attribute;
418  if (!is_int($friendlyName)) {
419  $t->FriendlyName = $friendlyName;
420  }
421  if ($nameFormat !== \SAML2\Constants::NAMEFORMAT_UNSPECIFIED) {
422  $t->NameFormat = $nameFormat;
423  }
424  if (in_array($attribute, $attributesrequired, true)) {
425  $t->isRequired = true;
426  }
427  $attributeconsumer->RequestedAttribute[] = $t;
428  }
429 
430  $spDesc->AttributeConsumingService[] = $attributeconsumer;
431  }
432 
433 
440  public function addMetadata($set, $metadata)
441  {
442  assert(is_string($set));
443  assert(is_array($metadata));
444 
445  $this->setExpiration($metadata);
446 
447  switch ($set) {
448  case 'saml20-sp-remote':
449  $this->addMetadataSP20($metadata);
450  break;
451  case 'saml20-idp-remote':
452  $this->addMetadataIdP20($metadata);
453  break;
454  case 'shib13-sp-remote':
455  $this->addMetadataSP11($metadata);
456  break;
457  case 'shib13-idp-remote':
458  $this->addMetadataIdP11($metadata);
459  break;
460  case 'attributeauthority-remote':
462  break;
463  default:
464  SimpleSAML\Logger::warning('Unable to generate metadata for unknown type \''.$set.'\'.');
465  }
466  }
467 
468 
475  public function addMetadataSP20($metadata, $protocols = array(\SAML2\Constants::NS_SAMLP))
476  {
477  assert(is_array($metadata));
478  assert(is_array($protocols));
479  assert(isset($metadata['entityid']));
480  assert(isset($metadata['metadata-set']));
481 
482  $metadata = SimpleSAML_Configuration::loadFromArray($metadata, $metadata['entityid']);
483 
484  $e = new \SAML2\XML\md\SPSSODescriptor();
485  $e->protocolSupportEnumeration = $protocols;
486 
487  if ($metadata->hasValue('saml20.sign.assertion')) {
488  $e->WantAssertionsSigned = $metadata->getBoolean('saml20.sign.assertion');
489  }
490 
491  if ($metadata->hasValue('redirect.validate')) {
492  $e->AuthnRequestsSigned = $metadata->getBoolean('redirect.validate');
493  } elseif ($metadata->hasValue('validate.authnrequest')) {
494  $e->AuthnRequestsSigned = $metadata->getBoolean('validate.authnrequest');
495  }
496 
497  $this->addExtensions($metadata, $e);
498 
499  $this->addCertificate($e, $metadata);
500 
501  $e->SingleLogoutService = self::createEndpoints($metadata->getEndpoints('SingleLogoutService'), false);
502 
503  $e->NameIDFormat = $metadata->getArrayizeString('NameIDFormat', array());
504 
505  $endpoints = $metadata->getEndpoints('AssertionConsumerService');
506  foreach ($metadata->getArrayizeString('AssertionConsumerService.artifact', array()) as $acs) {
507  $endpoints[] = array(
508  'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact',
509  'Location' => $acs,
510  );
511  }
512  $e->AssertionConsumerService = self::createEndpoints($endpoints, true);
513 
514  $this->addAttributeConsumingService($e, $metadata);
515 
516  $this->entityDescriptor->RoleDescriptor[] = $e;
517 
518  foreach ($metadata->getArray('contacts', array()) as $contact) {
519  if (array_key_exists('contactType', $contact) && array_key_exists('emailAddress', $contact)) {
520  $this->addContact($contact['contactType'], \SimpleSAML\Utils\Config\Metadata::getContact($contact));
521  }
522  }
523  }
524 
525 
531  public function addMetadataIdP20($metadata)
532  {
533  assert(is_array($metadata));
534  assert(isset($metadata['entityid']));
535  assert(isset($metadata['metadata-set']));
536 
537  $metadata = SimpleSAML_Configuration::loadFromArray($metadata, $metadata['entityid']);
538 
539  $e = new \SAML2\XML\md\IDPSSODescriptor();
540  $e->protocolSupportEnumeration[] = 'urn:oasis:names:tc:SAML:2.0:protocol';
541 
542  if ($metadata->hasValue('sign.authnrequest')) {
543  $e->WantAuthnRequestsSigned = $metadata->getBoolean('sign.authnrequest');
544  } elseif ($metadata->hasValue('redirect.sign')) {
545  $e->WantAuthnRequestsSigned = $metadata->getBoolean('redirect.sign');
546  }
547 
548  $this->addExtensions($metadata, $e);
549 
550  $this->addCertificate($e, $metadata);
551 
552  if ($metadata->hasValue('ArtifactResolutionService')) {
553  $e->ArtifactResolutionService = self::createEndpoints(
554  $metadata->getEndpoints('ArtifactResolutionService'),
555  true
556  );
557  }
558 
559  $e->SingleLogoutService = self::createEndpoints($metadata->getEndpoints('SingleLogoutService'), false);
560 
561  $e->NameIDFormat = $metadata->getArrayizeString('NameIDFormat', array());
562 
563  $e->SingleSignOnService = self::createEndpoints($metadata->getEndpoints('SingleSignOnService'), false);
564 
565  $this->entityDescriptor->RoleDescriptor[] = $e;
566 
567  foreach ($metadata->getArray('contacts', array()) as $contact) {
568  if (array_key_exists('contactType', $contact) && array_key_exists('emailAddress', $contact)) {
569  $this->addContact($contact['contactType'], \SimpleSAML\Utils\Config\Metadata::getContact($contact));
570  }
571  }
572  }
573 
574 
580  public function addMetadataSP11($metadata)
581  {
582  assert(is_array($metadata));
583  assert(isset($metadata['entityid']));
584  assert(isset($metadata['metadata-set']));
585 
586  $metadata = SimpleSAML_Configuration::loadFromArray($metadata, $metadata['entityid']);
587 
588  $e = new \SAML2\XML\md\SPSSODescriptor();
589  $e->protocolSupportEnumeration[] = 'urn:oasis:names:tc:SAML:1.1:protocol';
590 
591  $this->addCertificate($e, $metadata);
592 
593  $e->NameIDFormat = $metadata->getArrayizeString('NameIDFormat', array());
594 
595  $endpoints = $metadata->getEndpoints('AssertionConsumerService');
596  foreach ($metadata->getArrayizeString('AssertionConsumerService.artifact', array()) as $acs) {
597  $endpoints[] = array(
598  'Binding' => 'urn:oasis:names:tc:SAML:1.0:profiles:artifact-01',
599  'Location' => $acs,
600  );
601  }
602  $e->AssertionConsumerService = self::createEndpoints($endpoints, true);
603 
604  $this->addAttributeConsumingService($e, $metadata);
605 
606  $this->entityDescriptor->RoleDescriptor[] = $e;
607  }
608 
609 
615  public function addMetadataIdP11($metadata)
616  {
617  assert(is_array($metadata));
618  assert(isset($metadata['entityid']));
619  assert(isset($metadata['metadata-set']));
620 
621  $metadata = SimpleSAML_Configuration::loadFromArray($metadata, $metadata['entityid']);
622 
623  $e = new \SAML2\XML\md\IDPSSODescriptor();
624  $e->protocolSupportEnumeration[] = 'urn:oasis:names:tc:SAML:1.1:protocol';
625  $e->protocolSupportEnumeration[] = 'urn:mace:shibboleth:1.0';
626 
627  $this->addCertificate($e, $metadata);
628 
629  $e->NameIDFormat = $metadata->getArrayizeString('NameIDFormat', array());
630 
631  $e->SingleSignOnService = self::createEndpoints($metadata->getEndpoints('SingleSignOnService'), false);
632 
633  $this->entityDescriptor->RoleDescriptor[] = $e;
634  }
635 
636 
643  public function addAttributeAuthority(array $metadata)
644  {
645  assert(is_array($metadata));
646  assert(isset($metadata['entityid']));
647  assert(isset($metadata['metadata-set']));
648 
649  $metadata = SimpleSAML_Configuration::loadFromArray($metadata, $metadata['entityid']);
650 
651  $e = new \SAML2\XML\md\AttributeAuthorityDescriptor();
652  $e->protocolSupportEnumeration = $metadata->getArray('protocols', array(\SAML2\Constants::NS_SAMLP));
653 
654  $this->addExtensions($metadata, $e);
655  $this->addCertificate($e, $metadata);
656 
657  $e->AttributeService = self::createEndpoints($metadata->getEndpoints('AttributeService'), false);
658  $e->AssertionIDRequestService = self::createEndpoints(
659  $metadata->getEndpoints('AssertionIDRequestService'),
660  false
661  );
662 
663  $e->NameIDFormat = $metadata->getArrayizeString('NameIDFormat', array());
664 
665  $this->entityDescriptor->RoleDescriptor[] = $e;
666  }
667 
668 
682  public function addContact($type, $details)
683  {
684  assert(is_string($type));
685  assert(is_array($details));
686  assert(in_array($type, array('technical', 'support', 'administrative', 'billing', 'other'), true));
687 
688  // TODO: remove this check as soon as getContact() is called always before calling this function
689  $details = \SimpleSAML\Utils\Config\Metadata::getContact($details);
690 
691  $e = new \SAML2\XML\md\ContactPerson();
692  $e->contactType = $type;
693 
694  if (!empty($details['attributes'])) {
695  $e->ContactPersonAttributes = $details['attributes'];
696  }
697 
698  if (isset($details['company'])) {
699  $e->Company = $details['company'];
700  }
701  if (isset($details['givenName'])) {
702  $e->GivenName = $details['givenName'];
703  }
704  if (isset($details['surName'])) {
705  $e->SurName = $details['surName'];
706  }
707 
708  if (isset($details['emailAddress'])) {
709  $eas = $details['emailAddress'];
710  if (!is_array($eas)) {
711  $eas = array($eas);
712  }
713  foreach ($eas as $ea) {
714  $e->EmailAddress[] = $ea;
715  }
716  }
717 
718  if (isset($details['telephoneNumber'])) {
719  $tlfNrs = $details['telephoneNumber'];
720  if (!is_array($tlfNrs)) {
721  $tlfNrs = array($tlfNrs);
722  }
723  foreach ($tlfNrs as $tlfNr) {
724  $e->TelephoneNumber[] = $tlfNr;
725  }
726  }
727 
728  $this->entityDescriptor->ContactPerson[] = $e;
729  }
730 
731 
739  private function addX509KeyDescriptor(\SAML2\XML\md\RoleDescriptor $rd, $use, $x509data)
740  {
741  assert(in_array($use, array('encryption', 'signing'), true));
742  assert(is_string($x509data));
743 
744  $keyDescriptor = \SAML2\Utils::createKeyDescriptor($x509data);
745  $keyDescriptor->use = $use;
746  $rd->KeyDescriptor[] = $keyDescriptor;
747  }
748 
749 
758  private function addCertificate(\SAML2\XML\md\RoleDescriptor $rd, SimpleSAML_Configuration $metadata)
759  {
760  $keys = $metadata->getPublicKeys();
761  foreach ($keys as $key) {
762  if ($key['type'] !== 'X509Certificate') {
763  continue;
764  }
765  if (!isset($key['signing']) || $key['signing'] === true) {
766  $this->addX509KeyDescriptor($rd, 'signing', $key['X509Certificate']);
767  }
768  if (!isset($key['encryption']) || $key['encryption'] === true) {
769  $this->addX509KeyDescriptor($rd, 'encryption', $key['X509Certificate']);
770  }
771  }
772 
773  if ($metadata->hasValue('https.certData')) {
774  $this->addX509KeyDescriptor($rd, 'signing', $metadata->getString('https.certData'));
775  }
776  }
777 }
addMetadataSP11($metadata)
Add metadata of a SAML 1.1 service provider.
addOrganization(array $orgName, array $orgDisplayName, array $orgURL)
Add an Organization element based on data passed as parameters.
getArray($name, $default=self::REQUIRED_OPTION)
This function retrieves an array configuration option.
static arrayize($data, $index=0)
Put a non-array variable into an array.
Definition: Arrays.php:24
addExtensions(SimpleSAML_Configuration $metadata, \SAML2\XML\md\RoleDescriptor $e)
Add extensions to the metadata.
hasValue($name)
Check whether a key in the configuration exists or not.
addOrganizationInfo(array $metadata)
Add an Organization element based on metadata array.
addMetadataIdP11($metadata)
Add metadata of a SAML 1.1 identity provider.
$s
Definition: pwgen.php:45
$metadata['__DYNAMIC:1__']
__construct($entityId, $maxCache=null, $maxDuration=null)
Initialize the SAML builder.
Definition: SAMLBuilder.php:47
addAttributeConsumingService(\SAML2\XML\md\SPSSODescriptor $spDesc, SimpleSAML_Configuration $metadata)
Add an AttributeConsumingService element to the metadata.
addAttributeAuthority(array $metadata)
Add metadata of a SAML attribute authority.
addSecurityTokenServiceType($metadata)
Add a SecurityTokenServiceType for ADFS metadata.
static createEndpoints(array $endpoints, $indexed)
Add a list of endpoints to metadata.
getEntityDescriptorText($formatted=true)
Retrieve the EntityDescriptor as text.
Definition: SAMLBuilder.php:99
static warning($string)
Definition: Logger.php:177
addCertificate(\SAML2\XML\md\RoleDescriptor $rd, SimpleSAML_Configuration $metadata)
Add a certificate.
getLocalizedString($name, $default=self::REQUIRED_OPTION)
Retrieve a string which may be localized into many languages.
getBoolean($name, $default=self::REQUIRED_OPTION)
This function retrieves a boolean configuration option.
if(array_key_exists('yes', $_REQUEST)) $attributes
Definition: getconsent.php:85
addMetadata($set, $metadata)
Add a specific type of metadata to an entity.
foreach( $name as $i=> $nameSection)( $i==count( $name) - 1)( $nameSection) ?></span ><?php else from https
Definition: header.html.php:3
if($source===null) if(!($source instanceof sspmod_saml_Auth_Source_SP)) $entityId
Definition: metadata.php:22
getInteger($name, $default=self::REQUIRED_OPTION)
This function retrieves an integer configuration option.
static xsDateTimeToTimestamp($time)
This function converts a SAML2 timestamp on the form yyyy-mm-ddThh:mm:ss(.s+)?Z to a UNIX timestamp...
Definition: Utils.php:721
getString($name, $default=self::REQUIRED_OPTION)
This function retrieves a string configuration option.
addMetadataIdP20($metadata)
Add metadata of a SAML 2.0 identity provider.
$ret
Definition: parser.php:6
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
Definition: langwiz.php:349
if($name !==null &&!empty($attributes)) $orgName
Definition: metadata.php:178
getEntityDescriptor()
Retrieve the EntityDescriptor element which is generated for this entity.
Definition: SAMLBuilder.php:81
if(function_exists('posix_getuid') &&posix_getuid()===0) if(!array_key_exists('t', $options)) $tag
Definition: cron.php:35
static loadFromArray($config, $location='[ARRAY]', $instance=null)
Loads a configuration from the given array.
addMetadataSP20($metadata, $protocols=array(\SAML2\Constants::NS_SAMLP))
Add SAML 2.0 SP metadata.