PHP Класс SimpleSAML_XHTML_IdPDisco, simplesamlphp

Experimental support added for Extended IdP Metadata Discovery Protocol by Andreas 2008-08-28 More information: http://rnd.feide.no/content/extended-identity-provider-discovery-service-protocol
Автор: Olav Morken, UNINETT AS.
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$config SimpleSAML_Configuration An instance of the configuration class.
$instance string The identifier of this discovery service.
$isPassive boolean HTTP parameter from the request, indicating whether the discovery service can interact with the user or not.
$metadata SimpleSAML_Metadata_MetaDataStorageHandler An instance of the metadata handler, which will allow us to fetch metadata about IdPs.
$metadataSets array The metadata sets we find allowed entities in, in prioritized order.
$returnIdParam string This option default to 'entityID' for Shibboleth compatibility.
$returnURL string The URL the user should be redirected to after choosing an IdP.
$scopedIDPList array The list of scoped idp's. The intersection between the metadata idpList and scopedIDPList (given as a $_GET IDPList[] parameter) is presented to the user. If the intersection is empty the metadata idpList is used.
$session SimpleSAML_Session The users session.
$setIdPentityID string | null ..
$spEntityId string The entity id of the SP which accesses this IdP discovery service.

Открытые методы

Метод Описание
__construct ( array $metadataSets, string $instance ) Initializes this discovery service.
handleRequest ( ) Handles a request to this discovery service.

Защищенные методы

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

Описание методов

__construct() публичный Метод

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.

filterList() защищенный Метод

This method returns the IdPs that comply with the following conditions: - The IdP does not have the 'hide.from.discovery' configuration option.
protected filterList ( array $list ) : array
$list array An associative array containing metadata for the IdPs to apply the filtering to.
Результат array An associative array containing metadata for the IdPs that were not filtered out.

getCookie() защищенный Метод

This function will retrieve a cookie with the given name for the current discovery service type.
protected getCookie ( string $name ) : string
$name string The name of the cookie.
Результат string The value of the cookie with the given name, or null if no cookie with that name exists.

getFromCIDRhint() защищенный Метод

Retrieve a recommended IdP based on the IP address of the client.
protected getFromCIDRhint ( ) : string | null
Результат string | null The entity ID of the IdP if one is found, or null if not.

getIdPList() защищенный Метод

Retrieve the list of IdPs which are stored in the metadata.
protected getIdPList ( ) : array
Результат array An array with entityid => metadata mappings.

getPreviousIdP() защищенный Метод

Retrieve the previous IdP the user used.
protected getPreviousIdP ( ) : string
Результат string The entity id of the previous IdP the user used, or null if this is the first time.

getRecommendedIdP() защищенный Метод

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.
protected getRecommendedIdP ( ) : string
Результат string The entity id of the IdP the user should most likely use.

getSavedIdP() защищенный Метод

Retrieve the users saved choice of IdP.
protected getSavedIdP ( ) : string
Результат string The entity id of the IdP the user has saved, or null if the user hasn't saved any choice.

getScopedIDPList() защищенный Метод

Return the list of scoped idp
protected getScopedIDPList ( ) : array
Результат array An array of IdP entities

getSelectedIdP() защищенный Метод

This function finds out which IdP the user has manually chosen, if any.
protected getSelectedIdP ( ) : string
Результат string The entity id of the IdP the user has chosen, or null if the user has made no choice.

getTargetIdP() защищенный Метод

Determine which IdP the user should go to, if any.
protected getTargetIdP ( ) : string
Результат string The entity id of the IdP the user should be sent to, or null if the user should choose.

handleRequest() публичный Метод

The IdP disco parameters should be set before calling this function.
public handleRequest ( )

log() защищенный Метод

This is an helper function for logging messages. It will prefix the messages with our discovery service type.
protected log ( string $message )
$message string The message which should be logged.

saveIdP() защищенный Метод

Determine whether the choice of IdP should be saved.
protected saveIdP ( ) : boolean
Результат boolean True if the choice should be saved, false otherwise.

setCookie() защищенный Метод

This function will save a cookie with the given name and value for the current discovery service type.
protected setCookie ( string $name, string $value )
$name string The name of the cookie.
$value string The value of the cookie.

setPreviousIdP() защищенный Метод

Save the current IdP choice to a cookie.
protected setPreviousIdP ( string $idp )
$idp string The entityID of the IdP.

start() защищенный Метод

Check if an IdP is set or if the request is passive, and redirect accordingly.
protected start ( ) : void
Результат void If there is no IdP targeted and this is not a passive request.

validateIdP() защищенный Метод

Takes a string with the IdP entity id, and returns the entity id if it is valid, or null if not.
protected validateIdP ( string | null $idp ) : string | null
$idp string | null The entity id we want to validate. This can be null, in which case we will return null.
Результат string | null The entity id if it is valid, null if not.

Описание свойств

$config защищенное свойство

An instance of the configuration class.
protected SimpleSAML_Configuration $config
Результат SimpleSAML_Configuration

$instance защищенное свойство

The identifier of this discovery service.
protected string $instance
Результат string

$isPassive защищенное свойство

HTTP parameter from the request, indicating whether the discovery service can interact with the user or not.
protected bool $isPassive
Результат boolean

$metadata защищенное свойство

An instance of the metadata handler, which will allow us to fetch metadata about IdPs.
protected SimpleSAML_Metadata_MetaDataStorageHandler $metadata
Результат SimpleSAML_Metadata_MetaDataStorageHandler

$metadataSets защищенное свойство

The metadata sets we find allowed entities in, in prioritized order.
protected array $metadataSets
Результат array

$returnIdParam защищенное свойство

This option default to 'entityID' for Shibboleth compatibility.
protected string $returnIdParam
Результат string

$returnURL защищенное свойство

The URL the user should be redirected to after choosing an IdP.
protected string $returnURL
Результат string

$scopedIDPList защищенное свойство

The list of scoped idp's. The intersection between the metadata idpList and scopedIDPList (given as a $_GET IDPList[] parameter) is presented to the user. If the intersection is empty the metadata idpList is used.
protected array $scopedIDPList
Результат array

$session защищенное свойство

The users session.
protected SimpleSAML_Session $session
Результат SimpleSAML_Session

$setIdPentityID защищенное свойство

..
protected string|null $setIdPentityID
Результат string | null

$spEntityId защищенное свойство

The entity id of the SP which accesses this IdP discovery service.
protected string $spEntityId
Результат string