10 $requestid =
$query[
'wctx'];
21 'Responder' =>
array(
'sspmod_adfs_IdP_ADFS',
'sendResponse'),
23 'ForceAuthn' =>
false,
25 'adfs:wctx' => $requestid,
37 $nameidFormat =
'http://schemas.xmlsoap.org/claims/UPN';
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>
49 <saml:AuthenticationStatement AuthenticationMethod=
"urn:oasis:names:tc:SAML:1.0:am:unspecified" AuthenticationInstant=
"$issueInstant">
51 <saml:NameIdentifier Format=
"$nameidFormat">
$nameid</saml:NameIdentifier>
53 </saml:AuthenticationStatement>
54 <saml:AttributeStatement>
56 <saml:NameIdentifier Format=
"$nameidFormat">
$nameid</saml:NameIdentifier>
61 if ((!is_array($values)) || (count($values) == 0)) {
66 foreach ($values as $value) {
67 if ((!isset($value)) || ($value ===
'')) {
70 $value = htmlspecialchars($value);
73 <saml:Attribute AttributeNamespace=
"$namespace" AttributeName=
"$name">
74 <saml:AttributeValue>$value</saml:AttributeValue>
82 </saml:AttributeStatement>
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>
90 </wst:RequestSecurityTokenResponse>
99 $objXMLSecDSig->idKeys =
array(
'AssertionID');
100 $objXMLSecDSig->setCanonicalMethod(XMLSecurityDSig::EXC_C14N);
102 $firstassertionroot = $responsedom->getElementsByTagName(
'Assertion')->item(0);
103 $objXMLSecDSig->addReferenceList(
104 array($firstassertionroot), XMLSecurityDSig::SHA1,
105 array(
'http://www.w3.org/2000/09/xmldsig#enveloped-signature', XMLSecurityDSig::EXC_C14N),
106 array(
'id_name' =>
'AssertionID')
108 $objKey =
new XMLSecurityKey(XMLSecurityKey::RSA_SHA1,
array(
'type'=>
'private'));
109 $objKey->loadKey(
$key,
true);
110 $objXMLSecDSig->sign($objKey);
112 $public_cert = file_get_contents($cert);
113 $objXMLSecDSig->add509Cert($public_cert,
true);
115 $newSig = $responsedom->importNode($objXMLSecDSig->sigNode,
true);
116 $firstassertionroot->appendChild($newSig);
117 return $responsedom->saveXML();
122 $wresult = htmlspecialchars($wresult);
123 $wctx = htmlspecialchars($wctx);
126 <body onload=
"document.forms[0].submit()">
127 <form method=
"post" action=
"$url">
128 <input type=
"hidden" name=
"wa" value=
"wsignin1.0">
129 <input type=
"hidden" name=
"wresult" value=
"$wresult">
130 <input type=
"hidden" name=
"wctx" value=
"$wctx">
132 <input type=
"submit" value=
"Continue">
147 '$metadata[' . var_export(
$spEntityId,
true) .
']');
151 $nameidattribute =
$spMetadata->getValue(
'simplesaml.nameidattribute');
152 if (!empty($nameidattribute)) {
153 if (!array_key_exists($nameidattribute,
$attributes)) {
154 throw new Exception(
'simplesaml.nameidattribute does not exist in resulting attribute set');
167 'Handler' =>
'sspmod_adfs_IdP_ADFS',
177 $wctx = $state[
'adfs:wctx'];
193 if (isset(
$_GET[
'wreply']) && !empty(
$_GET[
'wreply'])) {
199 'Responder' =>
array(
'sspmod_adfs_IdP_ADFS',
'sendLogoutResponse'),
215 return $spMetadata->getValue(
'prp') .
'?' .
'wa=wsignoutcleanup1.0&wreply=' . urlencode(
$returnTo);
handleLogoutRequest(array &$state, $assocId)
Process a logout request.
if($err=$client->getError()) $namespace
static receiveAuthnRequest(SimpleSAML_IdP $idp)
static generateID()
Generate a random identifier, ID_LENGTH bytes long.
doLogoutRedirect($url)
Log out, then redirect to a URL.
static getAttributeNamespace($name, $defaultns)
Extract an attribute's namespace, or revert to default.
handleAuthenticationRequest(array &$state)
Process authentication requests.
if(!isset($_REQUEST['ReturnTo'])) $returnTo
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
static getByState(array &$state)
Retrieve the IdP "owning" the state.
static getLogoutURL(SimpleSAML_IdP $idp, array $association, $relayState)
static redirectTrustedURL($url, $parameters=array())
This function redirects to the specified URL without performing any security checks.
static sendLogoutResponse(SimpleSAML_IdP $idp, array $state)
$metadata['__DYNAMIC:1__']
static generateTimestamp($instant=null)
This function generates a timestamp on the form used by the SAML protocols.
static getModuleURL($resource, array $parameters=array())
Get absolute URL to a specified module resource.
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
Attribute-related utility methods.
static signResponse($response, $key, $cert)
getBaseURL($t, $type='get', $key=null, $value=null)
getConfig()
Retrieve the configuration for this IdP.
static postResponse($url, $wresult, $wctx)
catch(Exception $e) if(!($request instanceof \SAML2\ArtifactResolve)) $issuer
Create styles array
The data for the language used.
if(!isset($associations[$assocId])) $association
static getCertPath($path)
Resolves a path that may be relative to the cert-directory.
$sc SubjectConfirmationData NotOnOrAfter
if(!isset($_REQUEST['association'])) $assocId
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
static loadFromArray($config, $location='[ARRAY]', $instance=null)
Loads a configuration from the given array.
static sendResponse(array $state)
static generateResponse($issuer, $target, $nameid, $attributes)
static receiveLogoutMessage(SimpleSAML_IdP $idp)