ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
SAML2\Assertion\Processor Class Reference

@SuppressWarnings(PHPMD.CouplingBetweenObjects) - due to all the named exceptions More...

+ Collaboration diagram for SAML2\Assertion\Processor:

Public Member Functions

 __construct (Decrypter $decrypter, Validator $signatureValidator, AssertionValidator $assertionValidator, SubjectConfirmationValidator $subjectConfirmationValidator, Transformer $transformer, IdentityProvider $identityProviderConfiguration, LoggerInterface $logger)
 
 processAssertions ($assertions)
 
 process ($assertion)
 
 validateAssertion (Assertion $assertion)
 

Private Member Functions

 decryptAssertion ($assertion)
 
 transformAssertion (Assertion $assertion)
 

Private Attributes

 $decrypter
 
 $assertionValidator
 
 $subjectConfirmationValidator
 
 $transformer
 
 $signatureValidator
 
 $identityProviderConfiguration
 
 $logger
 

Detailed Description

@SuppressWarnings(PHPMD.CouplingBetweenObjects) - due to all the named exceptions

Definition at line 21 of file Processor.php.

Constructor & Destructor Documentation

◆ __construct()

SAML2\Assertion\Processor::__construct ( Decrypter  $decrypter,
Validator  $signatureValidator,
AssertionValidator  $assertionValidator,
SubjectConfirmationValidator  $subjectConfirmationValidator,
Transformer  $transformer,
IdentityProvider  $identityProviderConfiguration,
LoggerInterface  $logger 
)

Member Function Documentation

◆ decryptAssertion()

SAML2\Assertion\Processor::decryptAssertion (   $assertion)
private
Parameters
\SAML2\Assertion | \SAML2\EncryptedAssertion$assertion
Returns
\SAML2\Assertion

Definition at line 125 of file Processor.php.

126 {
127 if ($this->decrypter->isEncryptionRequired() && $assertion instanceof Assertion) {
128 throw new UnencryptedAssertionFoundException();
129 }
130
131 if ($assertion instanceof Assertion) {
132 return $assertion;
133 }
134
135 return $this->decrypter->decrypt($assertion);
136 }

Referenced by SAML2\Assertion\Processor\process().

+ Here is the caller graph for this function:

◆ process()

SAML2\Assertion\Processor::process (   $assertion)
Parameters
\SAML2\Assertion | \SAML2\EncryptedAssertion$assertion
Returns
\SAML2\Assertion

Definition at line 96 of file Processor.php.

97 {
98 $assertion = $this->decryptAssertion($assertion);
99
100 if (!$assertion->getWasSignedAtConstruction()) {
101 $this->logger->info(sprintf(
102 'Assertion with id "%s" was not signed at construction, not verifying the signature',
103 $assertion->getId()
104 ));
105 } else {
106 $this->logger->info(sprintf('Verifying signature of Assertion with id "%s"', $assertion->getId()));
107
108 if (!$this->signatureValidator->hasValidSignature($assertion, $this->identityProviderConfiguration)) {
109 throw new InvalidSignatureException();
110 }
111 }
112
113 $this->validateAssertion($assertion);
114
115 $assertion = $this->transformAssertion($assertion);
116
117 return $assertion;
118 }
sprintf('%.4f', $callTime)
validateAssertion(Assertion $assertion)
Definition: Processor.php:141
decryptAssertion($assertion)
Definition: Processor.php:125
transformAssertion(Assertion $assertion)
Definition: Processor.php:169

References SAML2\Assertion\Processor\decryptAssertion(), sprintf, SAML2\Assertion\Processor\transformAssertion(), and SAML2\Assertion\Processor\validateAssertion().

Referenced by SAML2\Assertion\Processor\processAssertions().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ processAssertions()

SAML2\Assertion\Processor::processAssertions (   $assertions)
Parameters
\SAML2\Utilities\ArrayCollection$assertions
Returns
\SAML2\Assertion[] Collection (\SAML2\Utilities\ArrayCollection) of processed assertions

Definition at line 81 of file Processor.php.

82 {
83 $processed = new ArrayCollection();
84 foreach ($assertions as $assertion) {
85 $processed->add($this->process($assertion));
86 }
87
88 return $processed;
89 }

References SAML2\Assertion\Processor\process().

+ Here is the call graph for this function:

◆ transformAssertion()

SAML2\Assertion\Processor::transformAssertion ( Assertion  $assertion)
private
Parameters
\SAML2\Assertion$assertion
Returns
\SAML2\Assertion

Definition at line 169 of file Processor.php.

170 {
171 return $this->transformer->transform($assertion);
172 }

Referenced by SAML2\Assertion\Processor\process().

+ Here is the caller graph for this function:

◆ validateAssertion()

SAML2\Assertion\Processor::validateAssertion ( Assertion  $assertion)
Parameters
\SAML2\Assertion$assertion

Definition at line 141 of file Processor.php.

142 {
143 $assertionValidationResult = $this->assertionValidator->validate($assertion);
144 if (!$assertionValidationResult->isValid()) {
145 throw new InvalidAssertionException(sprintf(
146 'Invalid Assertion in SAML Response, erorrs: "%s"',
147 implode('", "', $assertionValidationResult->getErrors())
148 ));
149 }
150
151 foreach ($assertion->getSubjectConfirmation() as $subjectConfirmation) {
152 $subjectConfirmationValidationResult = $this->subjectConfirmationValidator->validate(
153 $subjectConfirmation
154 );
155 if (!$subjectConfirmationValidationResult->isValid()) {
156 throw new InvalidSubjectConfirmationException(sprintf(
157 'Invalid SubjectConfirmation in Assertion, errors: "%s"',
158 implode('", "', $subjectConfirmationValidationResult->getErrors())
159 ));
160 }
161 }
162 }

References SAML2\Assertion\getSubjectConfirmation(), and sprintf.

Referenced by SAML2\Assertion\Processor\process().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $assertionValidator

SAML2\Assertion\Processor::$assertionValidator
private

Definition at line 31 of file Processor.php.

Referenced by SAML2\Assertion\Processor\__construct().

◆ $decrypter

SAML2\Assertion\Processor::$decrypter
private

Definition at line 26 of file Processor.php.

Referenced by SAML2\Assertion\Processor\__construct().

◆ $identityProviderConfiguration

SAML2\Assertion\Processor::$identityProviderConfiguration
private

Definition at line 51 of file Processor.php.

Referenced by SAML2\Assertion\Processor\__construct().

◆ $logger

SAML2\Assertion\Processor::$logger
private

Definition at line 56 of file Processor.php.

Referenced by SAML2\Assertion\Processor\__construct().

◆ $signatureValidator

SAML2\Assertion\Processor::$signatureValidator
private

Definition at line 46 of file Processor.php.

Referenced by SAML2\Assertion\Processor\__construct().

◆ $subjectConfirmationValidator

SAML2\Assertion\Processor::$subjectConfirmationValidator
private

Definition at line 36 of file Processor.php.

Referenced by SAML2\Assertion\Processor\__construct().

◆ $transformer

SAML2\Assertion\Processor::$transformer
private

Definition at line 41 of file Processor.php.

Referenced by SAML2\Assertion\Processor\__construct().


The documentation for this class was generated from the following file: