PHP Class SimpleSAML_Metadata_SAMLBuilder, simplesamlphp

This class builds SAML 2.0 metadata for an entity by examining the metadata for the entity.
Exibir arquivo Open project: simplesamlphp/simplesamlphp Class Usage Examples

Public Methods

Method Description
__construct ( string $entityId, double | null $maxCache = null, double | null $maxDuration = null ) Initialize the SAML builder.
addAttributeAuthority ( array $metadata ) Add metadata of a SAML attribute authority.
addContact ( string $type, array $details ) Add contact information.
addMetadata ( string $set, array $metadata ) Add a specific type of metadata to an entity.
addMetadataIdP11 ( array $metadata ) Add metadata of a SAML 1.1 identity provider.
addMetadataIdP20 ( array $metadata ) Add metadata of a SAML 2.0 identity provider.
addMetadataSP11 ( array $metadata ) Add metadata of a SAML 1.1 service provider.
addMetadataSP20 ( array $metadata, array $protocols = [SAML2\Constants::NS_SAMLP] ) Add SAML 2.0 SP metadata.
addOrganization ( array $orgName, array $orgDisplayName, array $orgURL ) Add an Organization element based on data passed as parameters
addOrganizationInfo ( array $metadata ) Add an Organization element based on metadata array.
addSecurityTokenServiceType ( array $metadata ) Add a SecurityTokenServiceType for ADFS metadata.
getEntityDescriptor ( ) : DOMElement Retrieve the EntityDescriptor element which is generated for this entity.
getEntityDescriptorText ( boolean $formatted = true ) : string Retrieve the EntityDescriptor as text.

Private Methods

Method Description
addAttributeConsumingService ( SAML2\XML\md\SPSSODescriptor $spDesc, SimpleSAML_Configuration $metadata ) Add an AttributeConsumingService element to the metadata.
addCertificate ( SAML2\XML\md\RoleDescriptor $rd, SimpleSAML_Configuration $metadata ) Add a certificate.
addExtensions ( SimpleSAML_Configuration $metadata, SAML2\XML\md\RoleDescriptor $e ) Add extensions to the metadata.
addX509KeyDescriptor ( SAML2\XML\md\RoleDescriptor $rd, string $use, string $x509data ) Add a KeyDescriptor with an X509 certificate.
createEndpoints ( array $endpoints, boolean $indexed ) : array Add a list of endpoints to metadata.
setExpiration ( $metadata )

Method Details

__construct() public method

Initialize the SAML builder.
public __construct ( string $entityId, double | null $maxCache = null, double | null $maxDuration = null )
$entityId string The entity id of the entity.
$maxCache double | null The maximum time in seconds the metadata should be cached. Defaults to null
$maxDuration double | null The maximum time in seconds this metadata should be considered valid. Defaults to null.

addAttributeAuthority() public method

Add metadata of a SAML attribute authority.
public addAttributeAuthority ( array $metadata )
$metadata array The AttributeAuthorityDescriptor, in the format returned by SimpleSAML_Metadata_SAMLParser.

addContact() public method

Accepts a contact type, and a contact array that must be previously sanitized. WARNING: This function will change its signature and no longer parse a 'name' element.
public addContact ( string $type, array $details )
$type string The type of contact. Deprecated.
$details array The details about the contact.

addMetadata() public method

Add a specific type of metadata to an entity.
public addMetadata ( string $set, array $metadata )
$set string The metadata set this metadata comes from.
$metadata array The metadata.

addMetadataIdP11() public method

Add metadata of a SAML 1.1 identity provider.
public addMetadataIdP11 ( array $metadata )
$metadata array The metadata.

addMetadataIdP20() public method

Add metadata of a SAML 2.0 identity provider.
public addMetadataIdP20 ( array $metadata )
$metadata array The metadata.

addMetadataSP11() public method

Add metadata of a SAML 1.1 service provider.
public addMetadataSP11 ( array $metadata )
$metadata array The metadata.

addMetadataSP20() public method

Add SAML 2.0 SP metadata.
public addMetadataSP20 ( array $metadata, array $protocols = [SAML2\Constants::NS_SAMLP] )
$metadata array The metadata.
$protocols array The protocols supported. Defaults to \SAML2\Constants::NS_SAMLP.

addOrganization() public method

Add an Organization element based on data passed as parameters
public addOrganization ( array $orgName, array $orgDisplayName, array $orgURL )
$orgName array An array with the localized OrganizationName.
$orgDisplayName array An array with the localized OrganizationDisplayName.
$orgURL array An array with the localized OrganizationURL.

addOrganizationInfo() public method

Add an Organization element based on metadata array.
public addOrganizationInfo ( array $metadata )
$metadata array The metadata we should extract the organization information from.

addSecurityTokenServiceType() public method

Add a SecurityTokenServiceType for ADFS metadata.
public addSecurityTokenServiceType ( array $metadata )
$metadata array The metadata with the information about the SecurityTokenServiceType.

getEntityDescriptor() public method

Retrieve the EntityDescriptor element which is generated for this entity.
public getEntityDescriptor ( ) : DOMElement
return DOMElement The EntityDescriptor element of this entity.

getEntityDescriptorText() public method

This function serializes this EntityDescriptor, and returns it as text.
public getEntityDescriptorText ( boolean $formatted = true ) : string
$formatted boolean Whether the returned EntityDescriptor should be formatted first.
return string The serialized EntityDescriptor.