Aacotroneo\Saml2\Saml2Auth::getMetadata PHP Метод

getMetadata() публичный метод

Show metadata about the local sp. Use this to configure your saml2 IDP
public getMetadata ( ) : mixed
Результат mixed xml string representing metadata
    function getMetadata()
    {
        $auth = $this->auth;
        $settings = $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);
        }
    }

Usage Example

Пример #1
0
 /**
  * Show metadata about the local sp. Use this to configure your saml2 IDP
  *
  * @return mixed xml string representing metadata
  * @throws \InvalidArgumentException if metadata is not correctly set
  * @static 
  */
 public static function getMetadata()
 {
     return \Aacotroneo\Saml2\Saml2Auth::getMetadata();
 }