ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
SpIsValidAudience.php
Go to the documentation of this file.
1<?php
2
4
10
11class 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, true)) {
34 $result->addError(sprintf(
35 'The configured Service Provider [%s] is not a valid audience for the assertion. Audiences: [%s]',
37 implode('], [', $intendedAudiences)
38 ));
39 }
40 }
41}
$result
An exception for terminatinating execution or to throw for unit testing.
Simple Result object.
Definition: Result.php:11
getValidAudiences()
Retrieve the audiences that are allowed to receive this assertion.
Definition: Assertion.php:949
Basic Configuration Wrapper.
getEntityId()
Retrieve the entity id of this SP.
Definition: SP.php:81
Interface for triggering setter injection.
if( $source===null) if(!($source instanceof sspmod_saml_Auth_Source_SP)) $entityId
Definition: metadata.php:22