ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
SpIsValidAudience.php
Go to the documentation of this file.
1 <?php
2 
4 
10 
11 class SpIsValidAudience implements
14 {
19 
21  {
22  $this->serviceProvider = $serviceProvider;
23  }
24 
25  public function validate(Assertion $assertion, Result $result)
26  {
27  $intendedAudiences = $assertion->getValidAudiences();
28  if ($intendedAudiences === null) {
29  return;
30  }
31 
32  $entityId = $this->serviceProvider->getEntityId();
33  if (!in_array($entityId, $intendedAudiences)) {
34  $result->addError(sprintf(
35  'The configured Service Provider [%s] is not a valid audience for the assertion. Audiences: [%s]',
36  $entityId,
37  implode('], [', $intendedAudiences)
38  ));
39  }
40  }
41 }
Basic Configuration Wrapper.
$result
Simple Result object.
Definition: Result.php:10
getValidAudiences()
Retrieve the audiences that are allowed to receive this assertion.
Definition: Assertion.php:949
if($source===null) if(!($source instanceof sspmod_saml_Auth_Source_SP)) $entityId
Definition: metadata.php:22
Interface for triggering setter injection.