45 $this->metadata = $metadatastore;
72 $responseroot = $responsedom->getElementsByTagName(
'Response')->item(0);
73 $firstassertionroot = $responsedom->getElementsByTagName(
'Assertion')->item(0);
81 if ($spmd->
hasValue(
'signresponse')) {
82 $signResponse = $spmd->
getBoolean(
'signresponse');
84 $signResponse = $this->configuration->getBoolean(
'shib13.signresponse',
true);
88 if ($firstassertionroot === null) {
93 'privatekey_array' => $privatekey,
94 'publickey_array' => $publickey,
95 'id' => ($signResponse ?
'ResponseID' :
'AssertionID'),
98 if ($idpmd->
hasValue(
'certificatechain')) {
99 $signer->addCertificate($idpmd->
getString(
'certificatechain'));
105 $statusElements = XML::getDOMChildren($responseroot,
'Status',
'@saml1p');
106 assert(
'count($statusElements) === 1');
107 $signer->sign($responseroot, $responseroot, $statusElements[0]);
110 $signer->sign($firstassertionroot, $firstassertionroot);
119 'SAMLResponse' => base64_encode(
$response),
133 assert(
'is_array($post)');
135 if (!array_key_exists(
'SAMLResponse',
$post)) {
136 throw new \Exception(
'Missing required SAMLResponse parameter.');
138 $rawResponse =
$post[
'SAMLResponse'];
139 $samlResponseXML = base64_decode($rawResponse);
146 $samlResponse->setXML($samlResponseXML);
148 if (array_key_exists(
'TARGET',
$post)) {
149 $samlResponse->setRelayState(
$post[
'TARGET']);
152 return $samlResponse;
decodeResponse($post)
Decode a received response.
__construct(\SimpleSAML_Configuration $configuration, \SimpleSAML_Metadata_MetaDataStorageHandler $metadatastore)
Constructor for the class.
hasValue($name)
Check whether a key in the configuration exists or not.
static checkSAMLMessage($message, $type)
This function performs some sanity checks on XML documents, and optionally validates them against the...
sendResponse( $response, \SimpleSAML_Configuration $idpmd, \SimpleSAML_Configuration $spmd, $relayState, $shire)
Send an authenticationResponse using HTTP-POST.
static loadPrivateKey(\SimpleSAML_Configuration $metadata, $required=false, $prefix='', $full_path=false)
Load a private key from metadata.
static debugSAMLMessage($message, $type)
Helper function to log SAML messages that we send or receive.
static loadPublicKey(\SimpleSAML_Configuration $metadata, $required=false, $prefix='')
Get public key or certificate from metadata.
static submitPOSTData($destination, $data)
Submit a POST form to a specific destination.
getBoolean($name, $default=self::REQUIRED_OPTION)
This function retrieves a boolean configuration option.
Create styles array
The data for the language used.
getString($name, $default=self::REQUIRED_OPTION)
This function retrieves a string configuration option.