SAML V2.0 Metadata Extensions for Login and Discovery User Interface ============================= * Author: Timothy Ace [tace@synacor.com](mailto:tace@synacor.com) This is a reference for the SimpleSAMLphp implemenation of the [SAML V2.0 Attribute Extensions](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-attribute-ext.pdf) defined by OASIS. The `metadata/saml20-idp-hosted.php` entries are used to define the metadata extension items. An example of this is: array( 'urn:simplesamlphp:v1:simplesamlphp' => array('is', 'really', 'cool'), '{urn:simplesamlphp:v1}foo' => array('bar'), ), /* ... */ ); The OASIS specification primarily defines how to include arbitrary `Attribute` and `Assertion` elements within the metadata for an IdP. *Note*: SimpleSAMLphp does not support `Assertion` elements within the metadata at this time. Defining Attributes -------------- The `EntityAttributes` key is used to define the attributes in the metadata. Each item in the `EntityAttributes` array defines a new `` item in the metadata. The value for each key must be an array. Each item in this array produces a separte `` element within the `` element. 'EntityAttributes' => array( 'urn:simplesamlphp:v1:simplesamlphp' => array('is', 'really', 'cool'), ), This generates: is really cool Each `` element requires a `NameFormat` attribute. This is specified using curly braces at the beginning of the key name: 'EntityAttributes' => array( '{urn:simplesamlphp:v1}foo' => array('bar'), ), This generates: bar When the curly braces are omitted, the NameFormat is automatically set to "urn:oasis:names:tc:SAML:2.0:attrname-format:uri". Generated XML Metadata Examples ---------------- If given the following configuration... $metadata['https://www.example.com/saml/saml2/idp/metadata.php'] = array( 'host' => 'www.example.com', 'certificate' => 'example.com.crt', 'privatekey' => 'example.com.pem', 'auth' => 'example-userpass', 'EntityAttributes' => array( 'urn:simplesamlphp:v1:simplesamlphp' => array('is', 'really', 'cool'), '{urn:simplesamlphp:v1}foo' => array('bar'), ), ); ... will generate the following XML metadata: is really cool bar ...