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

Simple Builder that allows to build a new Assertion Processor. More...

+ Collaboration diagram for SAML2\Assertion\ProcessorBuilder:

Static Public Member Functions

static build (LoggerInterface $logger, Validator $signatureValidator, Destination $currentDestination, IdentityProvider $identityProvider, ServiceProvider $serviceProvider, Response $response)
 

Static Private Member Functions

static createAssertionValidator (IdentityProvider $identityProvider, ServiceProvider $serviceProvider)
 
static createSubjectConfirmationValidator (IdentityProvider $identityProvider, ServiceProvider $serviceProvider, Destination $currentDestination, Response $response)
 
static createAssertionTransformerChain (LoggerInterface $logger, PrivateKeyLoader $keyloader, IdentityProvider $identityProvider, ServiceProvider $serviceProvider)
 

Detailed Description

Simple Builder that allows to build a new Assertion Processor.

This is an excellent candidate for refactoring towards dependency injection

(PHPMD.CouplingBetweenObjects)

Definition at line 34 of file ProcessorBuilder.php.

Member Function Documentation

◆ build()

static SAML2\Assertion\ProcessorBuilder::build ( LoggerInterface  $logger,
Validator  $signatureValidator,
Destination  $currentDestination,
IdentityProvider  $identityProvider,
ServiceProvider  $serviceProvider,
Response  $response 
)
static

Definition at line 36 of file ProcessorBuilder.php.

43  {
44  $keyloader = new PrivateKeyLoader();
45  $decrypter = new Decrypter($logger, $identityProvider, $serviceProvider, $keyloader);
46  $assertionValidator = self::createAssertionValidator($identityProvider, $serviceProvider);
47  $subjectConfirmationValidator = self::createSubjectConfirmationValidator(
48  $identityProvider,
49  $serviceProvider,
50  $currentDestination,
51  $response
52  );
53 
54  $transformerChain = self::createAssertionTransformerChain(
55  $logger,
56  $keyloader,
57  $identityProvider,
58  $serviceProvider
59  );
60 
61  return new Processor(
62  $decrypter,
63  $signatureValidator,
64  $assertionValidator,
65  $subjectConfirmationValidator,
66  $transformerChain,
67  $identityProvider,
68  $logger
69  );
70  }
$response

◆ createAssertionTransformerChain()

static SAML2\Assertion\ProcessorBuilder::createAssertionTransformerChain ( LoggerInterface  $logger,
PrivateKeyLoader  $keyloader,
IdentityProvider  $identityProvider,
ServiceProvider  $serviceProvider 
)
staticprivate

Definition at line 115 of file ProcessorBuilder.php.

120  {
121  $chain = new TransformerChain($identityProvider, $serviceProvider);
122  $chain->addTransformerStep(new DecodeBase64Transformer());
123  $chain->addTransformerStep(
124  new NameIdDecryptionTransformer($logger, $keyloader)
125  );
126 
127  return $chain;
128  }

◆ createAssertionValidator()

static SAML2\Assertion\ProcessorBuilder::createAssertionValidator ( IdentityProvider  $identityProvider,
ServiceProvider  $serviceProvider 
)
staticprivate

Definition at line 72 of file ProcessorBuilder.php.

References NotOnOrAfter.

75  {
76  $validator = new AssertionValidator($identityProvider, $serviceProvider);
77  $validator->addConstraintValidator(new NotBefore());
78  $validator->addConstraintValidator(new NotOnOrAfter());
79  $validator->addConstraintValidator(new SessionNotOnOrAfter());
80  $validator->addConstraintValidator(new SpIsValidAudience());
81 
82  return $validator;
83  }
$sc SubjectConfirmationData NotOnOrAfter

◆ createSubjectConfirmationValidator()

static SAML2\Assertion\ProcessorBuilder::createSubjectConfirmationValidator ( IdentityProvider  $identityProvider,
ServiceProvider  $serviceProvider,
Destination  $currentDestination,
Response  $response 
)
staticprivate

Definition at line 85 of file ProcessorBuilder.php.

90  {
91  $validator = new SubjectConfirmationValidator($identityProvider, $serviceProvider);
92  $validator->addConstraintValidator(
93  new SubjectConfirmationMethod()
94  );
95  $validator->addConstraintValidator(
96  new SubjectConfirmationNotBefore()
97  );
98  $validator->addConstraintValidator(
99  new SubjectConfirmationNotOnOrAfter()
100  );
101  $validator->addConstraintValidator(
102  new SubjectConfirmationRecipientMatches(
103  $currentDestination
104  )
105  );
106  $validator->addConstraintValidator(
107  new SubjectConfirmationResponseToMatches(
108  $response
109  )
110  );
111 
112  return $validator;
113  }
$response

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