You are here

public static function Utilities::parseNameId in SAML SP 2.0 Single Sign On (SSO) - SAML Service Provider 8

1 call to Utilities::parseNameId()
SAML2_Assertion::parseSubject in src/SAML2_Assertion.php
Parse subject in assertion.

File

src/Utilities.php, line 315

Class

Utilities
This file is part of miniOrange SAML plugin.

Namespace

Drupal\miniorange_saml

Code

public static function parseNameId(DOMElement $xml) {
  $ret = array(
    'Value' => trim($xml->textContent),
  );
  foreach (array(
    'NameQualifier',
    'SPNameQualifier',
    'Format',
  ) as $attr) {
    if ($xml
      ->hasAttribute($attr)) {
      $ret[$attr] = $xml
        ->getAttribute($attr);
    }
  }
  return $ret;
}