| Conditions | 3 |
| Paths | 2 |
| Total Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | 2 | public function isValid(SamlAuthnRequest $authnRequest, AbstractProvider $serviceProvider) |
|
| 24 | { |
||
| 25 | //TODO validate Destination |
||
| 26 | |||
| 27 | // Validate Signature |
||
| 28 | 2 | $signingKey = $serviceProvider->signingXMLSecurityKey(); |
|
| 29 | |||
| 30 | 2 | if ($signingKey && ($sig = Utils::validateElement($authnRequest->toSignedXML()))) { |
|
| 31 | 2 | $authnRequest->addValidator( |
|
| 32 | [ |
||
| 33 | 2 | Utils::class, |
|
| 34 | 'validateSignature', |
||
| 35 | ], |
||
| 36 | 2 | $sig |
|
| 37 | ); |
||
| 38 | |||
| 39 | 2 | $authnRequest->validate($signingKey); |
|
| 40 | } |
||
| 41 | |||
| 42 | 2 | return true; |
|
| 43 | } |
||
| 44 | } |
||
| 45 |