public function SamlService::getMetadata in SAML Authentication 8
Same name and namespace in other branches
- 8.3 src/SamlService.php \Drupal\samlauth\SamlService::getMetadata()
- 8.2 src/SamlService.php \Drupal\samlauth\SamlService::getMetadata()
- 4.x src/SamlService.php \Drupal\samlauth\SamlService::getMetadata()
Show metadata about the local sp. Use this to configure your saml2 IDP
Return value
mixed xml string representing metadata
Throws
InvalidArgumentException
File
- src/
SamlService.php, line 54 - Contains Drupal\samlauth\SamlService.
Class
- SamlService
- Class SamlService.
Namespace
Drupal\samlauthCode
public function getMetadata() {
$settings = $this->auth
->getSettings();
$metadata = $settings
->getSPMetadata();
$errors = $settings
->validateMetadata($metadata);
if (empty($errors)) {
return $metadata;
}
else {
throw new InvalidArgumentException('Invalid SP metadata: ' . implode(', ', $errors), OneLogin_Saml2_Error::METADATA_SP_INVALID);
}
}