Skip to content
Snippets Groups Projects
Commit 028df18f authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg
Browse files

Allow to extend the IdP Disco class

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1043 44740490-163a-0410-bde0-09ae8108e29a
parent 9df221b3
No related branches found
No related tags found
No related merge requests found
...@@ -17,7 +17,7 @@ class SimpleSAML_XHTML_IdPDisco { ...@@ -17,7 +17,7 @@ class SimpleSAML_XHTML_IdPDisco {
/** /**
* The various discovery services we can host. * The various discovery services we can host.
*/ */
private static $discoTypes = array( protected static $discoTypes = array(
'saml20' => array( 'saml20' => array(
'metadata' => 'saml20-idp-remote', 'metadata' => 'saml20-idp-remote',
), ),
...@@ -33,55 +33,55 @@ class SimpleSAML_XHTML_IdPDisco { ...@@ -33,55 +33,55 @@ class SimpleSAML_XHTML_IdPDisco {
/** /**
* An instance of the configuration class. * An instance of the configuration class.
*/ */
private $config; protected $config;
/** /**
* An instance of the metadata handler, which will allow us to fetch metadata about IdPs. * An instance of the metadata handler, which will allow us to fetch metadata about IdPs.
*/ */
private $metadata; protected $metadata;
/** /**
* The users session. * The users session.
*/ */
private $session; protected $session;
/** /**
* Our discovery service type. * Our discovery service type.
*/ */
private $discoType; protected $discoType;
/** /**
* The entity id of the SP which accesses this IdP discovery service. * The entity id of the SP which accesses this IdP discovery service.
*/ */
private $spEntityId; protected $spEntityId;
/** /**
* HTTP parameter from the request, indicating whether the discovery service * HTTP parameter from the request, indicating whether the discovery service
* can interact with the user or not. * can interact with the user or not.
*/ */
private $isPassive; protected $isPassive;
/** /**
* The SP request to set the IdPentityID... * The SP request to set the IdPentityID...
*/ */
private $setIdPentityID = NULL; protected $setIdPentityID = NULL;
/** /**
* The name of the query parameter which should contain the users choice of IdP. * The name of the query parameter which should contain the users choice of IdP.
* This option default to 'entityID' for Shibboleth compatibility. * This option default to 'entityID' for Shibboleth compatibility.
*/ */
private $returnIdParam; protected $returnIdParam;
/** /**
* The URL the user should be redirected to after choosing an IdP. * The URL the user should be redirected to after choosing an IdP.
*/ */
private $returnURL; protected $returnURL;
/** /**
...@@ -155,7 +155,7 @@ class SimpleSAML_XHTML_IdPDisco { ...@@ -155,7 +155,7 @@ class SimpleSAML_XHTML_IdPDisco {
* *
* @param $message The message which should be logged. * @param $message The message which should be logged.
*/ */
private function log($message) { protected function log($message) {
SimpleSAML_Logger::info('idpDisco.' . $this->discoType['type'] . ': ' . $message); SimpleSAML_Logger::info('idpDisco.' . $this->discoType['type'] . ': ' . $message);
} }
...@@ -169,7 +169,7 @@ class SimpleSAML_XHTML_IdPDisco { ...@@ -169,7 +169,7 @@ class SimpleSAML_XHTML_IdPDisco {
* @param $name The name of the cookie. * @param $name The name of the cookie.
* @return The value of the cookie with the given name, or NULL if no cookie with that name exists. * @return The value of the cookie with the given name, or NULL if no cookie with that name exists.
*/ */
private function getCookie($name) { protected function getCookie($name) {
$prefixedName = 'idpdisco_' . $this->discoType['type'] . '_' . $name; $prefixedName = 'idpdisco_' . $this->discoType['type'] . '_' . $name;
if(array_key_exists($prefixedName, $_COOKIE)) { if(array_key_exists($prefixedName, $_COOKIE)) {
return $_COOKIE[$prefixedName]; return $_COOKIE[$prefixedName];
...@@ -188,7 +188,7 @@ class SimpleSAML_XHTML_IdPDisco { ...@@ -188,7 +188,7 @@ class SimpleSAML_XHTML_IdPDisco {
* @param $name The name of the cookie. * @param $name The name of the cookie.
* @param $value The value of the cookie. * @param $value The value of the cookie.
*/ */
private function setCookie($name, $value) { protected function setCookie($name, $value) {
$prefixedName = 'idpdisco_' . $this->discoType['type'] . '_' . $name; $prefixedName = 'idpdisco_' . $this->discoType['type'] . '_' . $name;
/* We save the cookies for 90 days. */ /* We save the cookies for 90 days. */
...@@ -210,7 +210,7 @@ class SimpleSAML_XHTML_IdPDisco { ...@@ -210,7 +210,7 @@ class SimpleSAML_XHTML_IdPDisco {
* @param $idp The entity id we want to validate. This can be NULL, in which case we will return NULL. * @param $idp The entity id we want to validate. This can be NULL, in which case we will return NULL.
* @return The entity id if it is valid, NULL if not. * @return The entity id if it is valid, NULL if not.
*/ */
private function validateIdP($idp) { protected function validateIdP($idp) {
if($idp === NULL) { if($idp === NULL) {
return NULL; return NULL;
} }
...@@ -237,7 +237,7 @@ class SimpleSAML_XHTML_IdPDisco { ...@@ -237,7 +237,7 @@ class SimpleSAML_XHTML_IdPDisco {
* *
* @return The entity id of the IdP the user has chosen, or NULL if the user has made no choice. * @return The entity id of the IdP the user has chosen, or NULL if the user has made no choice.
*/ */
private function getSelectedIdP() { protected function getSelectedIdP() {
/* Parameter set from the Extended IdP Metadata Discovery Service Protocol, /* Parameter set from the Extended IdP Metadata Discovery Service Protocol,
...@@ -275,7 +275,7 @@ class SimpleSAML_XHTML_IdPDisco { ...@@ -275,7 +275,7 @@ class SimpleSAML_XHTML_IdPDisco {
* *
* @return The entity id of the IdP the user has saved, or NULL if the user hasn't saved any choice. * @return The entity id of the IdP the user has saved, or NULL if the user hasn't saved any choice.
*/ */
private function getSavedIdP() { protected function getSavedIdP() {
if(!$this->config->getBoolean('idpdisco.enableremember', FALSE)) { if(!$this->config->getBoolean('idpdisco.enableremember', FALSE)) {
/* Saving of IdP choices is disabled. */ /* Saving of IdP choices is disabled. */
return NULL; return NULL;
...@@ -300,7 +300,7 @@ class SimpleSAML_XHTML_IdPDisco { ...@@ -300,7 +300,7 @@ class SimpleSAML_XHTML_IdPDisco {
* *
* @return The entity id of the previous IdP the user used, or NULL if this is the first time. * @return The entity id of the previous IdP the user used, or NULL if this is the first time.
*/ */
private function getPreviousIdP() { protected function getPreviousIdP() {
return $this->validateIdP($this->getCookie('lastidp')); return $this->validateIdP($this->getCookie('lastidp'));
} }
...@@ -313,7 +313,7 @@ class SimpleSAML_XHTML_IdPDisco { ...@@ -313,7 +313,7 @@ class SimpleSAML_XHTML_IdPDisco {
* *
* @return The entity id of the IdP the user should most likely use. * @return The entity id of the IdP the user should most likely use.
*/ */
private function getRecommendedIdP() { protected function getRecommendedIdP() {
$idp = $this->getPreviousIdP(); $idp = $this->getPreviousIdP();
if($idp !== NULL) { if($idp !== NULL) {
...@@ -338,7 +338,7 @@ class SimpleSAML_XHTML_IdPDisco { ...@@ -338,7 +338,7 @@ class SimpleSAML_XHTML_IdPDisco {
* *
* @return TRUE if the choice should be saved, FALSE if not. * @return TRUE if the choice should be saved, FALSE if not.
*/ */
private function saveIdP() { protected function saveIdP() {
if(!$this->config->getBoolean('idpdisco.enableremember', FALSE)) { if(!$this->config->getBoolean('idpdisco.enableremember', FALSE)) {
/* Saving of IdP choices is disabled. */ /* Saving of IdP choices is disabled. */
return FALSE; return FALSE;
...@@ -356,7 +356,7 @@ class SimpleSAML_XHTML_IdPDisco { ...@@ -356,7 +356,7 @@ class SimpleSAML_XHTML_IdPDisco {
* @return The entity id of the IdP the user should be sent to, or NULL if the user * @return The entity id of the IdP the user should be sent to, or NULL if the user
* should choose. * should choose.
*/ */
private function getTargetIdP() { protected function getTargetIdP() {
/* First, check if the user has chosen an IdP. */ /* First, check if the user has chosen an IdP. */
$idp = $this->getSelectedIdP(); $idp = $this->getSelectedIdP();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment