ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
IsSuccessful.php
Go to the documentation of this file.
1
<?
php
2
3
namespace
SAML2\Response\Validation\ConstraintValidator
;
4
5
use
SAML2\Constants
;
6
use
SAML2\Response
;
7
use
SAML2\Response\Validation\ConstraintValidator
;
8
use
SAML2\Response\Validation\Result
;
9
10
class
IsSuccessful
implements
11
ConstraintValidator
12
{
13
public
function
validate
(
14
Response
$response
,
15
Result
$result
16
) {
17
if
(!$response->
isSuccess
()) {
18
$result->
addError
($this->
buildMessage
($response->
getStatus
()));
19
}
20
}
21
27
private
function
buildMessage
(array $responseStatus)
28
{
29
return
sprintf(
30
'%s%s%s'
,
31
$this->
truncateStatus
($responseStatus[
'Code'
]),
32
$responseStatus[
'SubCode'
] ?
'/'
. $this->
truncateStatus
($responseStatus[
'SubCode'
]) :
''
,
33
$responseStatus[
'Message'
] ?
' '
. $responseStatus[
'Message'
] :
''
34
);
35
}
36
43
private
function
truncateStatus
(
$status
)
44
{
45
$prefixLength = strlen(
Constants::STATUS_PREFIX
);
46
if
(strpos(
$status
,
Constants::STATUS_PREFIX
) !== 0) {
47
return
$status
;
48
}
49
50
return
substr(
$status
, $prefixLength);
51
}
52
}
SAML2\Response\Validation\ConstraintValidator\IsSuccessful\truncateStatus
truncateStatus($status)
Truncate the status if it is prefixed by its urn.
Definition:
IsSuccessful.php:43
SAML2\Response\Validation\Result
Simple Result object.
Definition:
Result.php:10
$result
$result
Definition:
CleanUpTest.php:463
SAML2\Response\Validation\ConstraintValidator
Definition:
ConstraintValidator.php:7
Constants
SAML2\Response\Validation\ConstraintValidator\IsSuccessful
Definition:
IsSuccessful.php:10
SAML2\StatusResponse\getStatus
getStatus()
Retrieve the status code.
Definition:
StatusResponse.php:140
SAML2\Response
SAML2\Constants\STATUS_PREFIX
const STATUS_PREFIX
The status namespace.
Definition:
Constants.php:250
SAML2\Response\Validation\Result\addError
addError($message)
Definition:
Result.php:20
SAML2\StatusResponse\isSuccess
isSuccess()
Determine whether this is a successful response.
Definition:
StatusResponse.php:99
SAML2\Response
Definition:
Response.php:10
Result
SAML2\StatusResponse\$status
$status
Definition:
StatusResponse.php:40
php
$response
$response
Definition:
proxy_ylocal.php:39
SAML2\Response\Validation\ConstraintValidator
Definition:
DestinationMatches.php:3
SAML2\Response\Validation\ConstraintValidator\IsSuccessful\buildMessage
buildMessage(array $responseStatus)
Definition:
IsSuccessful.php:27
SAML2\Response\Validation\ConstraintValidator\IsSuccessful\validate
validate(Response $response, Result $result)
Definition:
IsSuccessful.php:13
libs
composer
vendor
simplesamlphp
saml2
src
SAML2
Response
Validation
ConstraintValidator
IsSuccessful.php
Generated on Thu Jan 16 2025 19:01:54 for ILIAS by
1.8.13 (using
Doxyfile
)