32 {
37 $nameidFormat = 'http://schemas.xmlsoap.org/claims/UPN';
39
41<wst:RequestSecurityTokenResponse xmlns:wst="http://schemas.xmlsoap.org/ws/2005/02/trust">
42 <wst:RequestedSecurityToken>
43 <saml:Assertion Issuer="$issuer" IssueInstant="$issueInstant" AssertionID="$assertionID" MinorVersion="1" MajorVersion="1" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion">
44 <saml:Conditions
NotOnOrAfter=
"$assertionExpire" NotBefore=
"$notBefore">
45 <saml:AudienceRestrictionCondition>
46 <saml:Audience>
$target</saml:Audience>
47 </saml:AudienceRestrictionCondition>
48 </saml:Conditions>
49 <saml:AuthenticationStatement AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:unspecified" AuthenticationInstant="$issueInstant">
50 <saml:Subject>
51 <saml:NameIdentifier Format=
"$nameidFormat">
$nameid</saml:NameIdentifier>
52 </saml:Subject>
53 </saml:AuthenticationStatement>
54 <saml:AttributeStatement>
55 <saml:Subject>
56 <saml:NameIdentifier Format=
"$nameidFormat">
$nameid</saml:NameIdentifier>
57 </saml:Subject>
58MSG;
59
61 if ((!is_array($values)) || (count($values) == 0)) {
62 continue;
63 }
64
66 foreach ($values as $value) {
67 if ((!isset($value)) || ($value === '')) {
68 continue;
69 }
70 $value = htmlspecialchars($value);
71
73 <saml:Attribute AttributeNamespace="$namespace" AttributeName="$name">
74 <saml:AttributeValue>$value</saml:AttributeValue>
75 </saml:Attribute>
76MSG;
77
78 }
79 }
80
82 </saml:AttributeStatement>
83 </saml:Assertion>
84 </wst:RequestedSecurityToken>
85 <wsp:AppliesTo xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
86 <wsa:EndpointReference xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
87 <wsa:Address>
$target</wsa:Address>
88 </wsa:EndpointReference>
89 </wsp:AppliesTo>
90</wst:RequestSecurityTokenResponse>
91MSG;
92
94 }
$sc SubjectConfirmationData NotOnOrAfter
static getAttributeNamespace($name, $defaultns)
Extract an attribute's namespace, or revert to default.
static generateID()
Generate a random identifier, ID_LENGTH bytes long.
static generateTimestamp($instant=null)
This function generates a timestamp on the form used by the SAML protocols.
if($err=$client->getError()) $namespace