You are here

function saml_sp__get_metadata in SAML Service Provider 3.x

Same name and namespace in other branches
  1. 8.3 saml_sp.module \saml_sp__get_metadata()
  2. 8.2 saml_sp.module \saml_sp__get_metadata()
  3. 7.8 saml_sp.module \saml_sp__get_metadata()
  4. 7.2 saml_sp.module \saml_sp__get_metadata()
  5. 7.3 saml_sp.module \saml_sp__get_metadata()
  6. 4.x saml_sp.module \saml_sp__get_metadata()

Load the settings and get the metadata.

2 calls to saml_sp__get_metadata()
SamlSpConfig::buildForm in src/Form/SamlSpConfig.php
Form constructor.
SamlSPController::metadata in src/Controller/SamlSPController.php
Generate the XMl metadata for the given IdP.

File

./saml_sp.module, line 221
SAML Service Provider.

Code

function saml_sp__get_metadata() {
  $settings = saml_sp__get_settings();
  try {
    $settings = new SamlSPSettings($settings);
    $metadata = $settings
      ->getSPMetadata();
    $errors = $settings
      ->validateMetadata($metadata);
  } catch (Exception $e) {
    $metadata = get_class($e) . ' - ' . $e
      ->getMessage();
  }
  return [
    $metadata,
    isset($errors) ? $errors : [],
  ];
}