You are here

class SamlSPResponse in SAML Service Provider 3.x

Same name and namespace in other branches
  1. 8.3 src/SAML/SamlSPResponse.php \Drupal\saml_sp\SAML\SamlSPResponse
  2. 8.2 src/SAML/SamlSPResponse.php \Drupal\saml_sp\SAML\SamlSPResponse
  3. 4.x src/SAML/SamlSPResponse.php \Drupal\saml_sp\SAML\SamlSPResponse

Provides the response.

Hierarchy

  • class \Drupal\saml_sp\SAML\SamlSPResponse extends \OneLogin\Saml2\Response

Expanded class hierarchy of SamlSPResponse

File

src/SAML/SamlSPResponse.php, line 10

Namespace

Drupal\saml_sp\SAML
View source
class SamlSPResponse extends Response {

  /**
   * Verifies that the document has the expected signed nodes.
   */
  public function validateSignedElements($signedElements) {
    if (count($signedElements) > 2) {
      return FALSE;
    }
    $ocurrence = array_count_values($signedElements);
    if (in_array('samlp:Response', $signedElements) && $ocurrence['samlp:Response'] > 1 || in_array('saml:Assertion', $signedElements) && $ocurrence['saml:Assertion'] > 1 || in_array('Assertion', $signedElements) && $ocurrence['Assertion'] > 1 || !in_array('samlp:Response', $signedElements) && !in_array('saml:Assertion', $signedElements) && !in_array('Assertion', $signedElements)) {
      return FALSE;
    }
    return TRUE;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
SamlSPResponse::validateSignedElements public function Verifies that the document has the expected signed nodes.