ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
Static Public Member Functions | |
static | addSign (SimpleSAML_Configuration $srcMetadata, SimpleSAML_Configuration $dstMetadata, \SAML2\SignedElement $element) |
Add signature key and sender certificate to an element (Message or Assertion). More... | |
static | checkSign (SimpleSAML_Configuration $srcMetadata, \SAML2\SignedElement $element) |
Check the signature on a SAML2 message or assertion. More... | |
static | validateMessage (SimpleSAML_Configuration $srcMetadata, SimpleSAML_Configuration $dstMetadata, \SAML2\Message $message) |
Check signature on a SAML2 message if enabled. More... | |
static | getDecryptionKeys (SimpleSAML_Configuration $srcMetadata, SimpleSAML_Configuration $dstMetadata) |
Retrieve the decryption keys from metadata. More... | |
static | getBlacklistedAlgorithms (SimpleSAML_Configuration $srcMetadata, SimpleSAML_Configuration $dstMetadata) |
Retrieve blacklisted algorithms. More... | |
static | getResponseError (\SAML2\StatusResponse $response) |
Retrieve the status code of a response as a sspmod_saml_Error. More... | |
static | buildAuthnRequest (SimpleSAML_Configuration $spMetadata, SimpleSAML_Configuration $idpMetadata) |
Build an authentication request based on information in the metadata. More... | |
static | buildLogoutRequest (SimpleSAML_Configuration $srcMetadata, SimpleSAML_Configuration $dstMetadata) |
Build a logout request based on information in the metadata. More... | |
static | buildLogoutResponse (SimpleSAML_Configuration $srcMetadata, SimpleSAML_Configuration $dstMetadata) |
Build a logout response based on information in the metadata. More... | |
static | processResponse (SimpleSAML_Configuration $spMetadata, SimpleSAML_Configuration $idpMetadata, \SAML2\Response $response) |
Process a response message. More... | |
static | getEncryptionKey (SimpleSAML_Configuration $metadata) |
Retrieve the encryption key for the given entity. More... | |
Static Private Member Functions | |
static | addRedirectSign (SimpleSAML_Configuration $srcMetadata, SimpleSAML_Configuration $dstMetadata, \SAML2\Message $message) |
Add signature key and and senders certificate to message. More... | |
static | findCertificate (array $certFingerprints, array $certificates) |
Find the certificate used to sign a message or assertion. More... | |
static | decryptAssertion (SimpleSAML_Configuration $srcMetadata, SimpleSAML_Configuration $dstMetadata, $assertion) |
Decrypt an assertion. More... | |
static | processAssertion (SimpleSAML_Configuration $spMetadata, SimpleSAML_Configuration $idpMetadata, \SAML2\Response $response, $assertion, $responseSigned) |
Process an assertion in a response. More... | |
Definition at line 10 of file Message.php.
|
staticprivate |
Add signature key and and senders certificate to message.
SimpleSAML_Configuration | $srcMetadata | The metadata of the sender. |
SimpleSAML_Configuration | $dstMetadata | The metadata of the recipient. |
\SAML2\Message | $message | The message we should add the data to. |
Definition at line 79 of file Message.php.
References $message, addSign(), and SimpleSAML_Configuration\getBoolean().
Referenced by buildAuthnRequest(), buildLogoutRequest(), and buildLogoutResponse().
|
static |
Add signature key and sender certificate to an element (Message or Assertion).
SimpleSAML_Configuration | $srcMetadata | The metadata of the sender. |
SimpleSAML_Configuration | $dstMetadata | The metadata of the recipient. |
\SAML2\SignedElement | $element | The element we should add the data to. |
Definition at line 20 of file Message.php.
References $algo, SimpleSAML_Configuration\getString(), SimpleSAML\Utils\Crypto\loadPrivateKey(), and SimpleSAML\Utils\Crypto\loadPublicKey().
Referenced by addRedirectSign(), sspmod_saml_IdP_SAML2\buildAssertion(), and sspmod_saml_IdP_SAML2\buildResponse().
|
static |
Build an authentication request based on information in the metadata.
SimpleSAML_Configuration | $spMetadata | The metadata of the service provider. |
SimpleSAML_Configuration | $idpMetadata | The metadata of the identity provider. |
Definition at line 431 of file Message.php.
References $idpMetadata, $spMetadata, addRedirectSign(), and SimpleSAML_Configuration\loadFromArray().
Referenced by sspmod_saml_Auth_Source_SP\startSSO2().
|
static |
Build a logout request based on information in the metadata.
SimpleSAML_Configuration | $srcMetadata | The metadata of the sender. |
SimpleSAML_Configuration | $dstMetadata | The metadata of the recipient. |
Definition at line 501 of file Message.php.
References $lr, addRedirectSign(), and SimpleSAML_Configuration\getString().
Referenced by sspmod_saml_IdP_SAML2\buildLogoutRequest(), and sspmod_saml_Auth_Source_SP\startSLO2().
|
static |
Build a logout response based on information in the metadata.
SimpleSAML_Configuration | $srcMetadata | The metadata of the sender. |
SimpleSAML_Configuration | $dstMetadata | The metadata of the recipient. |
Definition at line 521 of file Message.php.
References $lr, addRedirectSign(), and SimpleSAML_Configuration\getString().
Referenced by sspmod_saml_IdP_SAML2\sendLogoutResponse().
|
static |
Check the signature on a SAML2 message or assertion.
SimpleSAML_Configuration | $srcMetadata | The metadata of the sender. |
\SAML2\SignedElement | $element | Either a \SAML2\Response or a \SAML2\Assertion. |
SimpleSAML_Error_Exception if there is not certificate in the metadata for the entity.
Exception if the signature validation fails with an exception.
Definition at line 159 of file Message.php.
References $certificates, $i, $key, $keys, $res, SimpleSAML\Logger\debug(), findCertificate(), SimpleSAML_Configuration\getArrayizeString(), SimpleSAML_Configuration\getPublicKeys(), SimpleSAML_Configuration\getString(), SimpleSAML_Configuration\hasValue(), and SimpleSAML\Logger\notice().
Referenced by processResponse().
|
staticprivate |
Decrypt an assertion.
SimpleSAML_Configuration | $srcMetadata | The metadata of the sender (IdP). |
SimpleSAML_Configuration | $dstMetadata | The metadata of the recipient (SP). |
\SAML2\Assertion | \SAML2\EncryptedAssertion | $assertion | The assertion we are decrypting. |
SimpleSAML_Error_Exception if encryption is enabled but the assertion is not encrypted, or if we cannot get the decryption keys.
Exception if decryption fails for whatever reason.
Definition at line 367 of file Message.php.
References $i, $key, $keys, $ret, SimpleSAML\Logger\debug(), getBlacklistedAlgorithms(), SimpleSAML_Configuration\getBoolean(), and getDecryptionKeys().
Referenced by processAssertion().
|
staticprivate |
Find the certificate used to sign a message or assertion.
An exception is thrown if we are unable to locate the certificate.
array | $certFingerprints | The fingerprints we are looking for. |
array | $certificates | Array of certificates. |
SimpleSAML_Error_Exception | if we cannot find the certificate matching the fingerprint. |
Definition at line 124 of file Message.php.
References $certificates.
Referenced by checkSign().
|
static |
Retrieve blacklisted algorithms.
Remote configuration overrides local configuration.
SimpleSAML_Configuration | $srcMetadata | The metadata of the sender. |
SimpleSAML_Configuration | $dstMetadata | The metadata of the recipient. |
Definition at line 342 of file Message.php.
References SimpleSAML_Configuration\getArray().
Referenced by decryptAssertion(), and processAssertion().
|
static |
Retrieve the decryption keys from metadata.
SimpleSAML_Configuration | $srcMetadata | The metadata of the sender (IdP). |
SimpleSAML_Configuration | $dstMetadata | The metadata of the recipient (SP). |
Definition at line 291 of file Message.php.
References $key, $keys, SimpleSAML_Configuration\getString(), and SimpleSAML\Utils\Crypto\loadPrivateKey().
Referenced by decryptAssertion(), and processAssertion().
|
static |
Retrieve the encryption key for the given entity.
SimpleSAML_Configuration | $metadata | The metadata of the entity. |
SimpleSAML_Error_Exception if there is no supported encryption key in the metadata of this entity.
Definition at line 829 of file Message.php.
References $key, $keys, and $metadata.
Referenced by sspmod_saml_IdP_SAML2\buildAssertion(), sspmod_saml_IdP_SAML2\buildLogoutRequest(), and sspmod_saml_Auth_Source_SP\startSLO2().
|
static |
Retrieve the status code of a response as a sspmod_saml_Error.
\SAML2\StatusResponse | $response | The response. |
Definition at line 417 of file Message.php.
References $response.
Referenced by processResponse(), and sspmod_saml_IdP_SAML2\receiveLogoutMessage().
|
staticprivate |
Process an assertion in a response.
SimpleSAML_Configuration | $spMetadata | The metadata of the service provider. |
SimpleSAML_Configuration | $idpMetadata | The metadata of the identity provider. |
\SAML2\Response | $response | The response containing the assertion. |
\SAML2\Assertion | \SAML2\EncryptedAssertion | $assertion | The assertion. |
bool | $responseSigned | Whether the response is signed. |
SimpleSAML_Error_Exception if an error occurs while trying to validate the assertion, or if a assertion is not signed and it should be, or if we are unable to decrypt the NameID due to a local failure (missing or invalid decryption key).
Exception if we couldn't decrypt the NameID for unexpected reasons.
Definition at line 601 of file Message.php.
References $_SERVER, $attributes, $i, $idpMetadata, $key, $keys, $name, $response, $sc, $spEntityId, $spMetadata, data, SimpleSAML\Logger\debug(), decryptAssertion(), getBlacklistedAlgorithms(), getDecryptionKeys(), and SimpleSAML\Utils\HTTP\getSelfURLNoQuery().
Referenced by processResponse().
|
static |
Process a response message.
If the response is an error response, we will throw a sspmod_saml_Error exception with the error.
SimpleSAML_Configuration | $spMetadata | The metadata of the service provider. |
SimpleSAML_Configuration | $idpMetadata | The metadata of the identity provider. |
\SAML2\Response | $response | The response. |
SimpleSAML_Error_Exception if there are no assertions in the response.
Exception if the destination of the response does not match the current URL.
Definition at line 548 of file Message.php.
References $idpMetadata, $response, $ret, $spMetadata, checkSign(), getResponseError(), SimpleSAML\Utils\HTTP\getSelfURLNoQuery(), and processAssertion().
|
static |
Check signature on a SAML2 message if enabled.
SimpleSAML_Configuration | $srcMetadata | The metadata of the sender. |
SimpleSAML_Configuration | $dstMetadata | The metadata of the recipient. |
\SAML2\Message | $message | The message we should check the signature on. |
SimpleSAML_Error_Exception if message validation is enabled, but there is no signature in the message.
Definition at line 246 of file Message.php.
References $message, and SimpleSAML_Configuration\getBoolean().
Referenced by sspmod_saml_IdP_SAML2\receiveAuthnRequest(), and sspmod_saml_IdP_SAML2\receiveLogoutMessage().