SimpleSAML_XHTML_IdPDisco::__construct PHP Method

__construct() public method

The constructor does the parsing of the request. If this is an invalid request, it will throw an exception.
public __construct ( array $metadataSets, string $instance )
$metadataSets array Array with metadata sets we find remote entities in.
$instance string The name of this instance of the discovery service.
    public function __construct(array $metadataSets, $instance)
    {
        assert('is_string($instance)');
        // initialize standard classes
        $this->config = SimpleSAML_Configuration::getInstance();
        $this->metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
        $this->session = SimpleSAML_Session::getSessionFromRequest();
        $this->instance = $instance;
        $this->metadataSets = $metadataSets;
        $this->log('Accessing discovery service.');
        // standard discovery service parameters
        if (!array_key_exists('entityID', $_GET)) {
            throw new Exception('Missing parameter: entityID');
        } else {
            $this->spEntityId = $_GET['entityID'];
        }
        if (!array_key_exists('returnIDParam', $_GET)) {
            $this->returnIdParam = 'entityID';
        } else {
            $this->returnIdParam = $_GET['returnIDParam'];
        }
        $this->log('returnIdParam initially set to [' . $this->returnIdParam . ']');
        if (!array_key_exists('return', $_GET)) {
            throw new Exception('Missing parameter: return');
        } else {
            $this->returnURL = \SimpleSAML\Utils\HTTP::checkURLAllowed($_GET['return']);
        }
        $this->isPassive = false;
        if (array_key_exists('isPassive', $_GET)) {
            if ($_GET['isPassive'] === 'true') {
                $this->isPassive = true;
            }
        }
        $this->log('isPassive initially set to [' . ($this->isPassive ? 'TRUE' : 'FALSE') . ']');
        if (array_key_exists('IdPentityID', $_GET)) {
            $this->setIdPentityID = $_GET['IdPentityID'];
        }
        if (array_key_exists('IDPList', $_REQUEST)) {
            $this->scopedIDPList = $_REQUEST['IDPList'];
        }
    }

Usage Example

Esempio n. 1
0
 /**
  * Initializes this discovery service.
  *
  * The constructor does the parsing of the request. If this is an invalid request, it will
  * throw an exception.
  *
  * @param array $metadataSets  Array with metadata sets we find remote entities in.
  * @param string $instance  The name of this instance of the discovery service.
  */
 public function __construct(array $metadataSets, $instance)
 {
     parent::__construct($metadataSets, $instance);
     $this->discoconfig = SimpleSAML_Configuration::getConfig('module_discopower.php');
     $this->cdcDomain = $this->discoconfig->getString('cdc.domain', NULL);
     if ($this->cdcDomain !== NULL && $this->cdcDomain[0] !== '.') {
         /* Ensure that the CDC domain starts with a dot ('.') as required by the spec. */
         $this->cdcDomain = '.' . $this->cdcDomain;
     }
     $this->cdcLifetime = $this->discoconfig->getInteger('cdc.lifetime', NULL);
 }
All Usage Examples Of SimpleSAML_XHTML_IdPDisco::__construct