PHP 클래스 SimpleSAML_Auth_State, simplesamlphp

The state must be an associative array. This class will add additional keys to this array. These keys will always start with 'SimpleSAML_Auth_State.'. It is also possible to add a restart URL to the state. If state information is lost, for example because it timed out, or the user loaded a bookmarked page, the loadState function will redirect to this URL. To use this, set $state[SimpleSAML_Auth_State::RESTART] to this URL. Both the saveState and the loadState function takes in a $stage parameter. This parameter is a security feature, and is used to prevent the user from taking a state saved one place and using it as input a different place. The $stage parameter must be a unique string. To maintain uniqueness, it must be on the form "." or ":". There is also support for passing exceptions through the state. By defining an exception handler when creating the state array, users of the state array can call throwException with the state and the exception. This exception will be passed to the handler defined by the EXCEPTION_HANDLER_URL or EXCEPTION_HANDLER_FUNC elements of the state array.
저자: Olav Morken, UNINETT AS.
파일 보기 프로젝트 열기: simplesamlphp/simplesamlphp 1 사용 예제들

공개 메소드들

메소드 설명
cloneState ( array $state ) : array Clone the state.
deleteState ( &$state ) Delete state.
getPersistentAuthData ( array $state ) : array Get the persistent authentication state from the state array.
getStateId ( &$state, boolean $rawId = false ) : string Retrieve the ID of a state array.
loadExceptionState ( string | null $id = null ) : array | null Retrieve an exception state.
loadState ( string $id, string $stage, boolean $allowMissing = false ) : array | null Retrieve saved state.
parseStateID ( string $stateId ) : array Get the ID and (optionally) a URL embedded in a StateID, in the form 'id:url'.
saveState ( &$state, string $stage, boolean $rawId = false ) : string Save the state.
throwException ( array $state, SimpleSAML_Error_Exception $exception ) Throw exception to the state exception handler.

비공개 메소드들

메소드 설명
getStateTimeout ( ) : integer Retrieve state timeout.

메소드 상세

cloneState() 공개 정적인 메소드

This function clones and returns the new cloned state.
public static cloneState ( array $state ) : array
$state array The original request state.
리턴 array Cloned state data.

deleteState() 공개 정적인 메소드

This function deletes the given state to prevent the user from reusing it later.
public static deleteState ( &$state )

getPersistentAuthData() 공개 정적인 메소드

Get the persistent authentication state from the state array.
public static getPersistentAuthData ( array $state ) : array
$state array The state array to analyze.
리턴 array The persistent authentication state.

getStateId() 공개 정적인 메소드

Note that this function will not save the state.
public static getStateId ( &$state, boolean $rawId = false ) : string
$rawId boolean Return a raw ID, without a restart URL. Defaults to FALSE.
리턴 string Identifier which can be used to retrieve the state later.

loadExceptionState() 공개 정적인 메소드

Retrieve an exception state.
public static loadExceptionState ( string | null $id = null ) : array | null
$id string | null The exception id. Can be NULL, in which case it will be retrieved from the request.
리턴 array | null The state array with the exception, or NULL if no exception was thrown.

loadState() 공개 정적인 메소드

This function retrieves saved state information. If the state information has been lost, it will attempt to restart the request by calling the restart URL which is embedded in the state information. If there is no restart information available, an exception will be thrown.
public static loadState ( string $id, string $stage, boolean $allowMissing = false ) : array | null
$id string State identifier (with embedded restart information).
$stage string The stage the state should have been saved in.
$allowMissing boolean Whether to allow the state to be missing.
리턴 array | null State information, or null if the state is missing and $allowMissing is true.

parseStateID() 공개 정적인 메소드

Get the ID and (optionally) a URL embedded in a StateID, in the form 'id:url'.
저자: Andreas Solberg, UNINETT AS ([email protected])
저자: Jaime Perez, UNINETT AS ([email protected])
public static parseStateID ( string $stateId ) : array
$stateId string The state ID to use.
리턴 array A hashed array with the ID and the URL (if any), in the 'id' and 'url' keys, respectively. If there's no URL in the input parameter, NULL will be returned as the value for the 'url' key.

saveState() 공개 정적인 메소드

This function saves the state, and returns an id which can be used to retrieve it later. It will also update the $state array with the identifier.
public static saveState ( &$state, string $stage, boolean $rawId = false ) : string
$stage string The current stage in the login process.
$rawId boolean Return a raw ID, without a restart URL.
리턴 string Identifier which can be used to retrieve the state later.

throwException() 공개 정적인 메소드

Throw exception to the state exception handler.
public static throwException ( array $state, SimpleSAML_Error_Exception $exception )
$state array The state array.
$exception SimpleSAML_Error_Exception The exception.