PHP Class SimpleSAML_IdP, simplesamlphp

This class implements the various functions used by IdP.
显示文件 Open project: simplesamlphp/simplesamlphp Class Usage Examples

Public Methods

Method Description
addAssociation ( array $association ) Add an SP association.
doLogoutRedirect ( string $url ) Log out, then redirect to a URL.
finishLogout ( array &$state ) Finish the logout operation.
finishLogoutRedirect ( SimpleSAML_IdP $idp, array $state ) Redirect to a URL after logout.
getAssociations ( ) : array Retrieve list of SP associations.
getById ( string $id ) : SimpleSAML_IdP Retrieve an IdP by ID.
getByState ( array &$state ) : SimpleSAML_IdP Retrieve the IdP "owning" the state.
getConfig ( ) : SimpleSAML_Configuration Retrieve the configuration for this IdP.
getId ( ) : string Retrieve the ID of this IdP.
getLogoutHandler ( ) : SimpleSAML\IdP\LogoutHandlerInterface Find the logout handler of this IdP.
getSPName ( string $assocId ) : array | null Get SP name.
handleAuthenticationRequest ( array &$state ) Process authentication requests.
handleLogoutRequest ( array &$state, string | null $assocId ) Process a logout request.
handleLogoutResponse ( string $assocId, string | null $relayState, SimpleSAML_Error_Exception $error = null ) Process a logout response.
isAuthenticated ( ) : boolean Is the current user authenticated?
postAuth ( array $state ) The user is authenticated.
postAuthProc ( array $state ) Called after authproc has run.
terminateAssociation ( string $assocId ) Remove an SP association.

Private Methods

Method Description
__construct ( string $id ) Initialize an IdP.
authenticate ( array &$state ) Authenticate the user.
reauthenticate ( array &$state ) Re-authenticate the user.

Method Details

addAssociation() public method

Add an SP association.
public addAssociation ( array $association )
$association array The SP association.

doLogoutRedirect() public method

This function never returns.
public doLogoutRedirect ( string $url )
$url string The URL the user should be returned to after logout.

finishLogout() public method

This function will never return.
public finishLogout ( array &$state )
$state array

finishLogoutRedirect() public static method

This function never returns.
public static finishLogoutRedirect ( SimpleSAML_IdP $idp, array $state )
$idp SimpleSAML_IdP Deprecated. Will be removed.
$state array

getAssociations() public method

Retrieve list of SP associations.
public getAssociations ( ) : array
return array List of SP associations.

getById() public static method

Retrieve an IdP by ID.
public static getById ( string $id ) : SimpleSAML_IdP
$id string The identifier of the IdP.
return SimpleSAML_IdP The IdP.

getByState() public static method

Retrieve the IdP "owning" the state.
public static getByState ( array &$state ) : SimpleSAML_IdP
$state array
return SimpleSAML_IdP The IdP.

getConfig() public method

Retrieve the configuration for this IdP.
public getConfig ( ) : SimpleSAML_Configuration
return SimpleSAML_Configuration The configuration object.

getId() public method

Retrieve the ID of this IdP.
public getId ( ) : string
return string The ID of this IdP.

getLogoutHandler() public method

Find the logout handler of this IdP.
public getLogoutHandler ( ) : SimpleSAML\IdP\LogoutHandlerInterface
return SimpleSAML\IdP\LogoutHandlerInterface The logout handler class.

getSPName() public method

Get SP name.
public getSPName ( string $assocId ) : array | null
$assocId string The association identifier.
return array | null The name of the SP, as an associative array of language => text, or null if this isn't an SP.

handleAuthenticationRequest() public method

Process authentication requests.
public handleAuthenticationRequest ( array &$state )
$state array

handleLogoutRequest() public method

This function will never return.
public handleLogoutRequest ( array &$state, string | null $assocId )
$state array
$assocId string | null The association we received the logout request from, or null if there was no association.

handleLogoutResponse() public method

This function will never return.
public handleLogoutResponse ( string $assocId, string | null $relayState, SimpleSAML_Error_Exception $error = null )
$assocId string The association that is terminated.
$relayState string | null The RelayState from the start of the logout.
$error SimpleSAML_Error_Exception The error that occurred during session termination (if any).

isAuthenticated() public method

Is the current user authenticated?
public isAuthenticated ( ) : boolean
return boolean True if the user is authenticated, false otherwise.

postAuth() public static method

The user is authenticated.
public static postAuth ( array $state )
$state array The authentication request state array.

postAuthProc() public static method

Called after authproc has run.
public static postAuthProc ( array $state )
$state array The authentication request state array.

terminateAssociation() public method

Remove an SP association.
public terminateAssociation ( string $assocId )
$assocId string The association id.