ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
SimpleSAML_XHTML_IdPDisco Class Reference
+ Inheritance diagram for SimpleSAML_XHTML_IdPDisco:
+ Collaboration diagram for SimpleSAML_XHTML_IdPDisco:

Public Member Functions

 __construct (array $metadataSets, $instance)
 Initializes this discovery service. More...
 
 handleRequest ()
 Handles a request to this discovery service. More...
 

Protected Member Functions

 log ($message)
 Log a message. More...
 
 getCookie ($name)
 Retrieve cookie with the given name. More...
 
 setCookie ($name, $value)
 Save cookie with the given name and value. More...
 
 validateIdP ($idp)
 Validates the given IdP entity id. More...
 
 getSelectedIdP ()
 Retrieve the users choice of IdP. More...
 
 getSavedIdP ()
 Retrieve the users saved choice of IdP. More...
 
 getPreviousIdP ()
 Retrieve the previous IdP the user used. More...
 
 getFromCIDRhint ()
 Retrieve a recommended IdP based on the IP address of the client. More...
 
 getRecommendedIdP ()
 Try to determine which IdP the user should most likely use. More...
 
 setPreviousIdP ($idp)
 Save the current IdP choice to a cookie. More...
 
 saveIdP ()
 Determine whether the choice of IdP should be saved. More...
 
 getTargetIdP ()
 Determine which IdP the user should go to, if any. More...
 
 getIdPList ()
 Retrieve the list of IdPs which are stored in the metadata. More...
 
 getScopedIDPList ()
 Return the list of scoped idp. More...
 
 filterList ($list)
 Filter the list of IdPs. More...
 
 start ()
 Check if an IdP is set or if the request is passive, and redirect accordingly. More...
 

Protected Attributes

 $config
 
 $instance
 
 $metadata
 
 $session
 
 $metadataSets
 
 $spEntityId
 
 $isPassive
 
 $setIdPentityID = null
 
 $returnIdParam
 
 $scopedIDPList = array()
 
 $returnURL
 

Detailed Description

Definition at line 16 of file IdPDisco.php.

Constructor & Destructor Documentation

◆ __construct()

SimpleSAML_XHTML_IdPDisco::__construct ( array  $metadataSets,
  $instance 
)

Initializes this discovery service.

The constructor does the parsing of the request. If this is an invalid request, it will throw an exception.

Parameters
array$metadataSetsArray with metadata sets we find remote entities in.
string$instanceThe name of this instance of the discovery service.
Exceptions
ExceptionIf the request is invalid.

Definition at line 116 of file IdPDisco.php.

References $_GET, $instance, $metadataSets, SimpleSAML\Utils\HTTP\checkURLAllowed(), SimpleSAML_Configuration\getInstance(), SimpleSAML_Metadata_MetaDataStorageHandler\getMetadataHandler(), SimpleSAML_Session\getSessionFromRequest(), Sabre\Event\Loop\instance(), and log().

117  {
118  assert(is_string($instance));
119 
120  // initialize standard classes
121  $this->config = SimpleSAML_Configuration::getInstance();
124  $this->instance = $instance;
125  $this->metadataSets = $metadataSets;
126 
127  $this->log('Accessing discovery service.');
128 
129  // standard discovery service parameters
130  if (!array_key_exists('entityID', $_GET)) {
131  throw new Exception('Missing parameter: entityID');
132  } else {
133  $this->spEntityId = $_GET['entityID'];
134  }
135 
136  if (!array_key_exists('returnIDParam', $_GET)) {
137  $this->returnIdParam = 'entityID';
138  } else {
139  $this->returnIdParam = $_GET['returnIDParam'];
140  }
141 
142  $this->log('returnIdParam initially set to ['.$this->returnIdParam.']');
143 
144  if (!array_key_exists('return', $_GET)) {
145  throw new Exception('Missing parameter: return');
146  } else {
147  $this->returnURL = \SimpleSAML\Utils\HTTP::checkURLAllowed($_GET['return']);
148  }
149 
150  $this->isPassive = false;
151  if (array_key_exists('isPassive', $_GET)) {
152  if ($_GET['isPassive'] === 'true') {
153  $this->isPassive = true;
154  }
155  }
156  $this->log('isPassive initially set to ['.($this->isPassive ? 'TRUE' : 'FALSE').']');
157 
158  if (array_key_exists('IdPentityID', $_GET)) {
159  $this->setIdPentityID = $_GET['IdPentityID'];
160  }
161 
162  if (array_key_exists('IDPList', $_REQUEST)) {
163  $this->scopedIDPList = $_REQUEST['IDPList'];
164  }
165  }
static getMetadataHandler()
This function retrieves the current instance of the metadata handler.
static checkURLAllowed($url, array $trustedSites=null)
Check if a URL is valid and is in our list of allowed URLs.
Definition: HTTP.php:321
$_GET["client_id"]
log($message)
Log a message.
Definition: IdPDisco.php:176
instance(Loop $newLoop=null)
Retrieves or sets the global Loop object.
Definition: functions.php:173
static getSessionFromRequest()
Retrieves the current session.
Definition: Session.php:241
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.
+ Here is the call graph for this function:

Member Function Documentation

◆ filterList()

SimpleSAML_XHTML_IdPDisco::filterList (   $list)
protected

Filter the list of IdPs.

This method returns the IdPs that comply with the following conditions:

  • The IdP does not have the 'hide.from.discovery' configuration option.
Parameters
array$listAn associative array containing metadata for the IdPs to apply the filtering to.
Returns
array An associative array containing metadata for the IdPs that were not filtered out.

Definition at line 496 of file IdPDisco.php.

References $list, and $metadata.

Referenced by handleRequest().

497  {
498  foreach ($list as $entity => $metadata) {
499  if (array_key_exists('hide.from.discovery', $metadata) && $metadata['hide.from.discovery'] === true) {
500  unset($list[$entity]);
501  }
502  }
503  return $list;
504  }
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
+ Here is the caller graph for this function:

◆ getCookie()

SimpleSAML_XHTML_IdPDisco::getCookie (   $name)
protected

Retrieve cookie with the given name.

This function will retrieve a cookie with the given name for the current discovery service type.

Parameters
string$nameThe name of the cookie.
Returns
string The value of the cookie with the given name, or null if no cookie with that name exists.

Definition at line 192 of file IdPDisco.php.

References $_COOKIE, and $name.

Referenced by getPreviousIdP(), and getSavedIdP().

193  {
194  $prefixedName = 'idpdisco_'.$this->instance.'_'.$name;
195  if (array_key_exists($prefixedName, $_COOKIE)) {
196  return $_COOKIE[$prefixedName];
197  } else {
198  return null;
199  }
200  }
$_COOKIE['client_id']
Definition: server.php:9
+ Here is the caller graph for this function:

◆ getFromCIDRhint()

SimpleSAML_XHTML_IdPDisco::getFromCIDRhint ( )
protected

Retrieve a recommended IdP based on the IP address of the client.

Returns
string|null The entity ID of the IdP if one is found, or null if not.

Definition at line 344 of file IdPDisco.php.

References $_SERVER, and $idp.

Referenced by getRecommendedIdP().

345  {
346  foreach ($this->metadataSets as $metadataSet) {
347  $idp = $this->metadata->getPreferredEntityIdFromCIDRhint($metadataSet, $_SERVER['REMOTE_ADDR']);
348  if (!empty($idp)) {
349  return $idp;
350  }
351  }
352 
353  return null;
354  }
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
$idp
Definition: prp.php:13
+ Here is the caller graph for this function:

◆ getIdPList()

SimpleSAML_XHTML_IdPDisco::getIdPList ( )
protected

Retrieve the list of IdPs which are stored in the metadata.

Returns
array An array with entityid => metadata mappings.

Definition at line 459 of file IdPDisco.php.

Referenced by ilSimpleSAMLphplIdpDiscovery\getList(), sspmod_discopower_PowerIdPDisco\handleRequest(), and handleRequest().

460  {
461  $idpList = array();
462  foreach ($this->metadataSets as $metadataSet) {
463  $newList = $this->metadata->getList($metadataSet);
464  /*
465  * Note that we merge the entities in reverse order. This ensures that it is the entity in the first
466  * metadata set that "wins" if two metadata sets have the same entity.
467  */
468  $idpList = array_merge($newList, $idpList);
469  }
470 
471  return $idpList;
472  }
+ Here is the caller graph for this function:

◆ getPreviousIdP()

SimpleSAML_XHTML_IdPDisco::getPreviousIdP ( )
protected

Retrieve the previous IdP the user used.

Returns
string The entity id of the previous IdP the user used, or null if this is the first time.

Definition at line 333 of file IdPDisco.php.

References getCookie(), and validateIdP().

Referenced by getRecommendedIdP(), and getSavedIdP().

334  {
335  return $this->validateIdP($this->getCookie('lastidp'));
336  }
getCookie($name)
Retrieve cookie with the given name.
Definition: IdPDisco.php:192
validateIdP($idp)
Validates the given IdP entity id.
Definition: IdPDisco.php:238
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRecommendedIdP()

SimpleSAML_XHTML_IdPDisco::getRecommendedIdP ( )
protected

Try to determine which IdP the user should most likely use.

This function will first look at the previous IdP the user has chosen. If the user hasn't chosen an IdP before, it will look at the IP address.

Returns
string The entity id of the IdP the user should most likely use.

Definition at line 365 of file IdPDisco.php.

References $idp, getFromCIDRhint(), getPreviousIdP(), and log().

Referenced by sspmod_discopower_PowerIdPDisco\handleRequest(), and handleRequest().

366  {
367  $idp = $this->getPreviousIdP();
368  if ($idp !== null) {
369  $this->log('Preferred IdP from previous use ['.$idp.'].');
370  return $idp;
371  }
372 
373  $idp = $this->getFromCIDRhint();
374 
375  if (!empty($idp)) {
376  $this->log('Preferred IdP from CIDR hint ['.$idp.'].');
377  return $idp;
378  }
379 
380  return null;
381  }
getFromCIDRhint()
Retrieve a recommended IdP based on the IP address of the client.
Definition: IdPDisco.php:344
log($message)
Log a message.
Definition: IdPDisco.php:176
getPreviousIdP()
Retrieve the previous IdP the user used.
Definition: IdPDisco.php:333
$idp
Definition: prp.php:13
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSavedIdP()

SimpleSAML_XHTML_IdPDisco::getSavedIdP ( )
protected

Retrieve the users saved choice of IdP.

Returns
string The entity id of the IdP the user has saved, or null if the user hasn't saved any choice.

Definition at line 307 of file IdPDisco.php.

References getCookie(), getPreviousIdP(), and log().

Referenced by getTargetIdP().

308  {
309  if (!$this->config->getBoolean('idpdisco.enableremember', false)) {
310  // saving of IdP choices is disabled
311  return null;
312  }
313 
314  if ($this->getCookie('remember') === '1') {
315  $this->log('Return previously saved IdP because of remember cookie set to 1');
316  return $this->getPreviousIdP();
317  }
318 
319  if ($this->isPassive) {
320  $this->log('Return previously saved IdP because of isPassive');
321  return $this->getPreviousIdP();
322  }
323 
324  return null;
325  }
getCookie($name)
Retrieve cookie with the given name.
Definition: IdPDisco.php:192
log($message)
Log a message.
Definition: IdPDisco.php:176
getPreviousIdP()
Retrieve the previous IdP the user used.
Definition: IdPDisco.php:333
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getScopedIDPList()

SimpleSAML_XHTML_IdPDisco::getScopedIDPList ( )
protected

Return the list of scoped idp.

Returns
array An array of IdP entities

Definition at line 480 of file IdPDisco.php.

References $scopedIDPList.

Referenced by handleRequest().

481  {
482  return $this->scopedIDPList;
483  }
+ Here is the caller graph for this function:

◆ getSelectedIdP()

SimpleSAML_XHTML_IdPDisco::getSelectedIdP ( )
protected

Retrieve the users choice of IdP.

This function finds out which IdP the user has manually chosen, if any.

Returns
string The entity id of the IdP the user has chosen, or null if the user has made no choice.

Definition at line 271 of file IdPDisco.php.

References $_GET, $_SERVER, and validateIdP().

Referenced by getTargetIdP().

272  {
273  /* Parameter set from the Extended IdP Metadata Discovery Service Protocol, indicating that the user prefers
274  * this IdP.
275  */
276  if (!empty($this->setIdPentityID)) {
277  return $this->validateIdP($this->setIdPentityID);
278  }
279 
280  // user has clicked on a link, or selected the IdP from a drop-down list
281  if (array_key_exists('idpentityid', $_GET)) {
282  return $this->validateIdP($_GET['idpentityid']);
283  }
284 
285  /* Search for the IdP selection from the form used by the links view. This form uses a name which equals
286  * idp_<entityid>, so we search for that.
287  *
288  * Unfortunately, php replaces periods in the name with underscores, and there is no reliable way to get them
289  * back. Therefore we do some quick and dirty parsing of the query string.
290  */
291  $qstr = $_SERVER['QUERY_STRING'];
292  $matches = array();
293  if (preg_match('/(?:^|&)idp_([^=]+)=/', $qstr, $matches)) {
294  return $this->validateIdP(urldecode($matches[1]));
295  }
296 
297  // no IdP chosen
298  return null;
299  }
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
$_GET["client_id"]
validateIdP($idp)
Validates the given IdP entity id.
Definition: IdPDisco.php:238
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTargetIdP()

SimpleSAML_XHTML_IdPDisco::getTargetIdP ( )
protected

Determine which IdP the user should go to, if any.

Returns
string The entity id of the IdP the user should be sent to, or null if the user should choose.

Definition at line 423 of file IdPDisco.php.

References $idp, getSavedIdP(), getSelectedIdP(), log(), saveIdP(), setCookie(), and setPreviousIdP().

424  {
425  // first, check if the user has chosen an IdP
426  $idp = $this->getSelectedIdP();
427  if ($idp !== null) {
428  // the user selected this IdP. Save the choice in a cookie
429  $this->setPreviousIdP($idp);
430 
431  if ($this->saveIdP()) {
432  $this->setCookie('remember', '1');
433  } else {
434  $this->setCookie('remember', '0');
435  }
436 
437  return $idp;
438  }
439 
440  $this->log('getSelectedIdP() returned null');
441 
442  // check if the user has saved an choice earlier
443  $idp = $this->getSavedIdP();
444  if ($idp !== null) {
445  $this->log('Using saved choice ['.$idp.'].');
446  return $idp;
447  }
448 
449  // the user has made no choice
450  return null;
451  }
setPreviousIdP($idp)
Save the current IdP choice to a cookie.
Definition: IdPDisco.php:389
setCookie($name, $value)
Save cookie with the given name and value.
Definition: IdPDisco.php:212
log($message)
Log a message.
Definition: IdPDisco.php:176
getSelectedIdP()
Retrieve the users choice of IdP.
Definition: IdPDisco.php:271
getSavedIdP()
Retrieve the users saved choice of IdP.
Definition: IdPDisco.php:307
$idp
Definition: prp.php:13
saveIdP()
Determine whether the choice of IdP should be saved.
Definition: IdPDisco.php:403
+ Here is the call graph for this function:

◆ handleRequest()

SimpleSAML_XHTML_IdPDisco::handleRequest ( )

Handles a request to this discovery service.

The IdP disco parameters should be set before calling this function.

Definition at line 546 of file IdPDisco.php.

References $returnIdParam, $returnURL, $spEntityId, $t, filterList(), getIdPList(), getRecommendedIdP(), getScopedIDPList(), log(), SimpleSAML\Utils\HTTP\redirectTrustedURL(), and start().

547  {
548  $this->start();
549 
550  // no choice made. Show discovery service page
551  $idpList = $this->getIdPList();
552  $idpList = $this->filterList($idpList);
553  $preferredIdP = $this->getRecommendedIdP();
554 
555  $idpintersection = array_intersect(array_keys($idpList), $this->getScopedIDPList());
556  if (sizeof($idpintersection) > 0) {
557  $idpList = array_intersect_key($idpList, array_fill_keys($idpintersection, null));
558  }
559 
560  $idpintersection = array_values($idpintersection);
561 
562  if (sizeof($idpintersection) == 1) {
563  $this->log(
564  'Choice made ['.$idpintersection[0].'] (Redirecting the user back. returnIDParam='.
565  $this->returnIdParam.')'
566  );
568  $this->returnURL,
569  array($this->returnIdParam => $idpintersection[0])
570  );
571  }
572 
573  /*
574  * Make use of an XHTML template to present the select IdP choice to the user. Currently the supported options
575  * is either a drop down menu or a list view.
576  */
577  switch ($this->config->getString('idpdisco.layout', 'links')) {
578  case 'dropdown':
579  $templateFile = 'selectidp-dropdown.php';
580  break;
581  case 'links':
582  $templateFile = 'selectidp-links.php';
583  break;
584  default:
585  throw new Exception('Invalid value for the \'idpdisco.layout\' option.');
586  }
587 
588  $t = new SimpleSAML_XHTML_Template($this->config, $templateFile, 'disco');
589  $t->data['idplist'] = $idpList;
590  $t->data['preferredidp'] = $preferredIdP;
591  $t->data['return'] = $this->returnURL;
592  $t->data['returnIDParam'] = $this->returnIdParam;
593  $t->data['entityID'] = $this->spEntityId;
594  $t->data['urlpattern'] = htmlspecialchars(\SimpleSAML\Utils\HTTP::getSelfURLNoQuery());
595  $t->data['rememberenabled'] = $this->config->getBoolean('idpdisco.enableremember', false);
596  $t->show();
597  }
start()
Check if an IdP is set or if the request is passive, and redirect accordingly.
Definition: IdPDisco.php:512
static redirectTrustedURL($url, $parameters=array())
This function redirects to the specified URL without performing any security checks.
Definition: HTTP.php:959
Attribute-related utility methods.
getScopedIDPList()
Return the list of scoped idp.
Definition: IdPDisco.php:480
getIdPList()
Retrieve the list of IdPs which are stored in the metadata.
Definition: IdPDisco.php:459
log($message)
Log a message.
Definition: IdPDisco.php:176
getRecommendedIdP()
Try to determine which IdP the user should most likely use.
Definition: IdPDisco.php:365
filterList($list)
Filter the list of IdPs.
Definition: IdPDisco.php:496
+ Here is the call graph for this function:

◆ log()

SimpleSAML_XHTML_IdPDisco::log (   $message)
protected

Log a message.

This is an helper function for logging messages. It will prefix the messages with our discovery service type.

Parameters
string$messageThe message which should be logged.

Definition at line 176 of file IdPDisco.php.

References $message, SimpleSAML\Logger\info(), and Sabre\Event\Loop\instance().

Referenced by __construct(), getRecommendedIdP(), getSavedIdP(), getTargetIdP(), handleRequest(), setPreviousIdP(), start(), and validateIdP().

177  {
178  SimpleSAML\Logger::info('idpDisco.'.$this->instance.': '.$message);
179  }
static info($string)
Definition: Logger.php:199
catch(Exception $e) $message
instance(Loop $newLoop=null)
Retrieves or sets the global Loop object.
Definition: functions.php:173
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveIdP()

SimpleSAML_XHTML_IdPDisco::saveIdP ( )
protected

Determine whether the choice of IdP should be saved.

Returns
boolean True if the choice should be saved, false otherwise.

Definition at line 403 of file IdPDisco.php.

References $_GET.

Referenced by getTargetIdP().

404  {
405  if (!$this->config->getBoolean('idpdisco.enableremember', false)) {
406  // saving of IdP choices is disabled
407  return false;
408  }
409 
410  if (array_key_exists('remember', $_GET)) {
411  return true;
412  }
413 
414  return false;
415  }
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ setCookie()

SimpleSAML_XHTML_IdPDisco::setCookie (   $name,
  $value 
)
protected

Save cookie with the given name and value.

This function will save a cookie with the given name and value for the current discovery service type.

Parameters
string$nameThe name of the cookie.
string$valueThe value of the cookie.

Definition at line 212 of file IdPDisco.php.

References $name, PHPMailer\PHPMailer\$params, and SimpleSAML\Utils\HTTP\setCookie().

Referenced by getTargetIdP(), and setPreviousIdP().

213  {
214  $prefixedName = 'idpdisco_'.$this->instance.'_'.$name;
215 
216  $params = array(
217  // we save the cookies for 90 days
218  'lifetime' => (60 * 60 * 24 * 90),
219  // the base path for cookies. This should be the installation directory for SimpleSAMLphp
220  'path' => $this->config->getBasePath(),
221  'httponly' => false,
222  );
223 
224  \SimpleSAML\Utils\HTTP::setCookie($prefixedName, $value, $params, false);
225  }
static setCookie($name, $value, $params=null, $throw=true)
Set a cookie.
Definition: HTTP.php:1104
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setPreviousIdP()

SimpleSAML_XHTML_IdPDisco::setPreviousIdP (   $idp)
protected

Save the current IdP choice to a cookie.

Parameters
string$idpThe entityID of the IdP.

Definition at line 389 of file IdPDisco.php.

References $idp, log(), and setCookie().

Referenced by getTargetIdP().

390  {
391  assert(is_string($idp));
392 
393  $this->log('Choice made ['.$idp.'] Setting cookie.');
394  $this->setCookie('lastidp', $idp);
395  }
setCookie($name, $value)
Save cookie with the given name and value.
Definition: IdPDisco.php:212
log($message)
Log a message.
Definition: IdPDisco.php:176
$idp
Definition: prp.php:13
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ start()

SimpleSAML_XHTML_IdPDisco::start ( )
protected

Check if an IdP is set or if the request is passive, and redirect accordingly.

Returns
void If there is no IdP targeted and this is not a passive request.

Definition at line 512 of file IdPDisco.php.

References $idp, log(), and SimpleSAML\Utils\HTTP\redirectTrustedURL().

Referenced by sspmod_discopower_PowerIdPDisco\handleRequest(), and handleRequest().

513  {
514  $idp = $this->getTargetIdp();
515  if ($idp !== null) {
516  $extDiscoveryStorage = $this->config->getString('idpdisco.extDiscoveryStorage', null);
517  if ($extDiscoveryStorage !== null) {
518  $this->log('Choice made ['.$idp.'] (Forwarding to external discovery storage)');
519  \SimpleSAML\Utils\HTTP::redirectTrustedURL($extDiscoveryStorage, array(
520  'entityID' => $this->spEntityId,
521  'IdPentityID' => $idp,
522  'returnIDParam' => $this->returnIdParam,
523  'isPassive' => 'true',
524  'return' => $this->returnURL
525  ));
526  } else {
527  $this->log(
528  'Choice made ['.$idp.'] (Redirecting the user back. returnIDParam='.$this->returnIdParam.')'
529  );
530  \SimpleSAML\Utils\HTTP::redirectTrustedURL($this->returnURL, array($this->returnIdParam => $idp));
531  }
532  }
533 
534  if ($this->isPassive) {
535  $this->log('Choice not made. (Redirecting the user back without answer)');
537  }
538  }
static redirectTrustedURL($url, $parameters=array())
This function redirects to the specified URL without performing any security checks.
Definition: HTTP.php:959
log($message)
Log a message.
Definition: IdPDisco.php:176
$idp
Definition: prp.php:13
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ validateIdP()

SimpleSAML_XHTML_IdPDisco::validateIdP (   $idp)
protected

Validates the given IdP entity id.

Takes a string with the IdP entity id, and returns the entity id if it is valid, or null if not.

Parameters
string | null$idpThe entity id we want to validate. This can be null, in which case we will return null.
Returns
string|null The entity id if it is valid, null if not.

Definition at line 238 of file IdPDisco.php.

References $idp, and log().

Referenced by getPreviousIdP(), sspmod_discopower_PowerIdPDisco\getPreviousIdP(), and getSelectedIdP().

239  {
240  if ($idp === null) {
241  return null;
242  }
243 
244  if (!$this->config->getBoolean('idpdisco.validate', true)) {
245  return $idp;
246  }
247 
248  foreach ($this->metadataSets as $metadataSet) {
249  try {
250  $this->metadata->getMetaData($idp, $metadataSet);
251  return $idp;
252  } catch (Exception $e) {
253  // continue
254  }
255  }
256 
257  $this->log('Unable to validate IdP entity id ['.$idp.'].');
258 
259  // the entity id wasn't valid
260  return null;
261  }
log($message)
Log a message.
Definition: IdPDisco.php:176
$idp
Definition: prp.php:13
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $config

SimpleSAML_XHTML_IdPDisco::$config
protected

Definition at line 24 of file IdPDisco.php.

◆ $instance

SimpleSAML_XHTML_IdPDisco::$instance
protected

Definition at line 31 of file IdPDisco.php.

Referenced by sspmod_discopower_PowerIdPDisco\__construct(), and __construct().

◆ $isPassive

SimpleSAML_XHTML_IdPDisco::$isPassive
protected

Definition at line 71 of file IdPDisco.php.

◆ $metadata

SimpleSAML_XHTML_IdPDisco::$metadata
protected

Definition at line 39 of file IdPDisco.php.

Referenced by filterList(), and ilSimpleSAMLphplIdpDiscovery\storeIdpMetadata().

◆ $metadataSets

SimpleSAML_XHTML_IdPDisco::$metadataSets
protected

Definition at line 55 of file IdPDisco.php.

Referenced by __construct().

◆ $returnIdParam

SimpleSAML_XHTML_IdPDisco::$returnIdParam
protected

Definition at line 87 of file IdPDisco.php.

Referenced by sspmod_discopower_PowerIdPDisco\handleRequest(), and handleRequest().

◆ $returnURL

SimpleSAML_XHTML_IdPDisco::$returnURL
protected

Definition at line 103 of file IdPDisco.php.

Referenced by sspmod_discopower_PowerIdPDisco\handleRequest(), and handleRequest().

◆ $scopedIDPList

SimpleSAML_XHTML_IdPDisco::$scopedIDPList = array()
protected

Definition at line 96 of file IdPDisco.php.

Referenced by getScopedIDPList().

◆ $session

SimpleSAML_XHTML_IdPDisco::$session
protected

Definition at line 47 of file IdPDisco.php.

◆ $setIdPentityID

SimpleSAML_XHTML_IdPDisco::$setIdPentityID = null
protected

Definition at line 78 of file IdPDisco.php.

◆ $spEntityId

SimpleSAML_XHTML_IdPDisco::$spEntityId
protected

Definition at line 63 of file IdPDisco.php.

Referenced by sspmod_discopower_PowerIdPDisco\handleRequest(), and handleRequest().


The documentation for this class was generated from the following file: