PHP Class sspmod_saml_Message, simplesamlphp

Mostrar archivo Open project: simplesamlphp/simplesamlphp Class Usage Examples

Public Methods

Method Description
addSign ( SimpleSAML_Configuration $srcMetadata, SimpleSAML_Configuration $dstMetadata, SAML2\SignedElement $element ) Add signature key and sender certificate to an element (Message or Assertion).
buildAuthnRequest ( SimpleSAML_Configuration $spMetadata, SimpleSAML_Configuration $idpMetadata ) Build an authentication request based on information in the metadata.
buildLogoutRequest ( SimpleSAML_Configuration $srcMetadata, SimpleSAML_Configuration $dstMetadata ) Build a logout request based on information in the metadata.
buildLogoutResponse ( SimpleSAML_Configuration $srcMetadata, SimpleSAML_Configuration $dstMetadata ) Build a logout response based on information in the metadata.
checkSign ( SimpleSAML_Configuration $srcMetadata, SAML2\SignedElement $element ) Check the signature on a SAML2 message or assertion.
getBlacklistedAlgorithms ( SimpleSAML_Configuration $srcMetadata, SimpleSAML_Configuration $dstMetadata ) : array Retrieve blacklisted algorithms.
getDecryptionKeys ( SimpleSAML_Configuration $srcMetadata, SimpleSAML_Configuration $dstMetadata ) : array Retrieve the decryption keys from metadata.
getEncryptionKey ( SimpleSAML_Configuration $metadata ) : XMLSecurityKey Retrieve the encryption key for the given entity.
getResponseError ( SAML2\StatusResponse $response ) : sspmod_saml_Error Retrieve the status code of a response as a sspmod_saml_Error.
processResponse ( SimpleSAML_Configuration $spMetadata, SimpleSAML_Configuration $idpMetadata, SAML2\Response $response ) : array Process a response message.
validateMessage ( SimpleSAML_Configuration $srcMetadata, SimpleSAML_Configuration $dstMetadata, Message $message ) Check signature on a SAML2 message if enabled.

Private Methods

Method Description
addRedirectSign ( SimpleSAML_Configuration $srcMetadata, SimpleSAML_Configuration $dstMetadata, Message $message ) Add signature key and and senders certificate to message.
decryptAssertion ( SimpleSAML_Configuration $srcMetadata, SimpleSAML_Configuration $dstMetadata, Assertion | SAML2\EncryptedAssertion $assertion ) : Assertion Decrypt an assertion.
findCertificate ( array $certFingerprints, array $certificates ) : string Find the certificate used to sign a message or assertion.
processAssertion ( SimpleSAML_Configuration $spMetadata, SimpleSAML_Configuration $idpMetadata, SAML2\Response $response, Assertion | SAML2\EncryptedAssertion $assertion, boolean $responseSigned ) : Assertion Process an assertion in a response.

Method Details

addSign() public static method

Add signature key and sender certificate to an element (Message or Assertion).
public static addSign ( SimpleSAML_Configuration $srcMetadata, SimpleSAML_Configuration $dstMetadata, SAML2\SignedElement $element )
$srcMetadata SimpleSAML_Configuration The metadata of the sender.
$dstMetadata SimpleSAML_Configuration The metadata of the recipient.
$element SAML2\SignedElement The element we should add the data to.

buildAuthnRequest() public static method

Build an authentication request based on information in the metadata.
public static buildAuthnRequest ( SimpleSAML_Configuration $spMetadata, SimpleSAML_Configuration $idpMetadata )
$spMetadata SimpleSAML_Configuration The metadata of the service provider.
$idpMetadata SimpleSAML_Configuration The metadata of the identity provider.

buildLogoutRequest() public static method

Build a logout request based on information in the metadata.
public static buildLogoutRequest ( SimpleSAML_Configuration $srcMetadata, SimpleSAML_Configuration $dstMetadata )
$srcMetadata SimpleSAML_Configuration The metadata of the sender.
$dstMetadata SimpleSAML_Configuration

buildLogoutResponse() public static method

Build a logout response based on information in the metadata.
public static buildLogoutResponse ( SimpleSAML_Configuration $srcMetadata, SimpleSAML_Configuration $dstMetadata )
$srcMetadata SimpleSAML_Configuration The metadata of the sender.
$dstMetadata SimpleSAML_Configuration

checkSign() public static method

Check the signature on a SAML2 message or assertion.
public static checkSign ( SimpleSAML_Configuration $srcMetadata, SAML2\SignedElement $element )
$srcMetadata SimpleSAML_Configuration The metadata of the sender.
$element SAML2\SignedElement Either a \SAML2\Response or a \SAML2\Assertion.

getBlacklistedAlgorithms() public static method

Remote configuration overrides local configuration.
public static getBlacklistedAlgorithms ( SimpleSAML_Configuration $srcMetadata, SimpleSAML_Configuration $dstMetadata ) : array
$srcMetadata SimpleSAML_Configuration The metadata of the sender.
$dstMetadata SimpleSAML_Configuration The metadata of the recipient.
return array Array of blacklisted algorithms.

getDecryptionKeys() public static method

Retrieve the decryption keys from metadata.
public static getDecryptionKeys ( SimpleSAML_Configuration $srcMetadata, SimpleSAML_Configuration $dstMetadata ) : array
$srcMetadata SimpleSAML_Configuration The metadata of the sender (IdP).
$dstMetadata SimpleSAML_Configuration The metadata of the recipient (SP).
return array Array of decryption keys.

getEncryptionKey() public static method

Retrieve the encryption key for the given entity.
public static getEncryptionKey ( SimpleSAML_Configuration $metadata ) : XMLSecurityKey
$metadata SimpleSAML_Configuration The metadata of the entity.
return XMLSecurityKey The encryption key.

getResponseError() public static method

Retrieve the status code of a response as a sspmod_saml_Error.
public static getResponseError ( SAML2\StatusResponse $response ) : sspmod_saml_Error
$response SAML2\StatusResponse The response.
return sspmod_saml_Error The error.

processResponse() public static method

If the response is an error response, we will throw a sspmod_saml_Error exception with the error.
public static processResponse ( SimpleSAML_Configuration $spMetadata, SimpleSAML_Configuration $idpMetadata, SAML2\Response $response ) : array
$spMetadata SimpleSAML_Configuration The metadata of the service provider.
$idpMetadata SimpleSAML_Configuration The metadata of the identity provider.
$response SAML2\Response The response.
return array Array with \SAML2\Assertion objects, containing valid assertions from the response.

validateMessage() public static method

Check signature on a SAML2 message if enabled.
public static validateMessage ( SimpleSAML_Configuration $srcMetadata, SimpleSAML_Configuration $dstMetadata, Message $message )
$srcMetadata SimpleSAML_Configuration The metadata of the sender.
$dstMetadata SimpleSAML_Configuration The metadata of the recipient.
$message SAML2\Message The message we should check the signature on.