protected function getSamlAssertion($response) {
      $xml = new \DOMDocument();
      $xml->loadXML($response);
      $xpath = new \DOMXPath($xml);

      if ($xpath->query("//*[name()='saml:Assertion']")->length > 0) {
        $nodeToken = $xpath->query("//*[name()='saml:Assertion']");
        if (!empty($nodeToken)) {
          return $nodeToken;
        }
      }
      return NULL;
    }