PHP 클래스 SimpleSAML_Auth_Simple, simplesamlphp

파일 보기 프로젝트 열기: simplesamlphp/simplesamlphp 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( string $authSource ) Create an instance with the specified authsource.
getAttributes ( ) : array Retrieve attributes of the current user.
getAuthData ( string $name ) : mixed | null Retrieve authentication data.
getAuthDataArray ( ) : array | null Retrieve all authentication data.
getAuthSource ( ) : SimpleSAML_Auth_Source Retrieve the implementing authentication source.
getLoginURL ( string | null $returnTo = null ) : string Retrieve a URL that can be used to log the user in.
getLogoutURL ( string | null $returnTo = null ) : string Retrieve a URL that can be used to log the user out.
isAuthenticated ( ) : boolean Check if the user is authenticated.
login ( array $params = [] ) Start an authentication process.
logout ( string | array | null $params = null ) Log the user out.
logoutCompleted ( array $state ) Called when logout operation completes.
requireAuth ( array $params = [] ) Require the user to be authenticated.

메소드 상세

__construct() 공개 메소드

Create an instance with the specified authsource.
public __construct ( string $authSource )
$authSource string The id of the authentication source.

getAttributes() 공개 메소드

This function will retrieve the attributes of the current user if the user is authenticated. If the user isn't authenticated, it will return an empty array.
public getAttributes ( ) : array
리턴 array The users attributes.

getAuthData() 공개 메소드

Retrieve authentication data.
public getAuthData ( string $name ) : mixed | null
$name string The name of the parameter, e.g. 'Attributes', 'Expire' or 'saml:sp:IdP'.
리턴 mixed | null The value of the parameter, or null if it isn't found or we are unauthenticated.

getAuthDataArray() 공개 메소드

Retrieve all authentication data.
public getAuthDataArray ( ) : array | null
리턴 array | null All persistent authentication data, or null if we aren't authenticated.

getAuthSource() 공개 메소드

Retrieve the implementing authentication source.
public getAuthSource ( ) : SimpleSAML_Auth_Source
리턴 SimpleSAML_Auth_Source The authentication source.

getLoginURL() 공개 메소드

Retrieve a URL that can be used to log the user in.
public getLoginURL ( string | null $returnTo = null ) : string
$returnTo string | null The page the user should be returned to afterwards. If this parameter is null, the user will be returned to the current page.
리턴 string A URL which is suitable for use in link-elements.

getLogoutURL() 공개 메소드

Retrieve a URL that can be used to log the user out.
public getLogoutURL ( string | null $returnTo = null ) : string
$returnTo string | null The page the user should be returned to afterwards. If this parameter is null, the user will be returned to the current page.
리턴 string A URL which is suitable for use in link-elements.

isAuthenticated() 공개 메소드

This function checks if the user is authenticated with the default authentication source selected by the 'default-authsource' option in 'config.php'.
public isAuthenticated ( ) : boolean
리턴 boolean True if the user is authenticated, false if not.

login() 공개 메소드

This function accepts an array $params, which controls some parts of the authentication. The accepted parameters depends on the authentication source being used. Some parameters are generic: - 'ErrorURL': A URL that should receive errors from the authentication. - 'KeepPost': If the current request is a POST request, keep the POST data until after the authentication. - 'ReturnTo': The URL the user should be returned to after authentication. - 'ReturnCallback': The function we should call after the user has finished authentication. Please note: this function never returns.
public login ( array $params = [] )
$params array Various options to the authentication request.

logout() 공개 메소드

This function logs the user out. It will never return. By default, it will cause a redirect to the current page after logging the user out, but a different URL can be given with the $params parameter. Generic parameters are: - 'ReturnTo': The URL the user should be returned to after logout. - 'ReturnCallback': The function that should be called after logout. - 'ReturnStateParam': The parameter we should return the state in when redirecting. - 'ReturnStateStage': The stage the state array should be saved with.
public logout ( string | array | null $params = null )
$params string | array | null Either the URL the user should be redirected to after logging out, or an array with parameters for the logout. If this parameter is null, we will return to the current page.

logoutCompleted() 공개 정적인 메소드

This function never returns.
public static logoutCompleted ( array $state )
$state array The state after the logout.

requireAuth() 공개 메소드

If the user is authenticated, this function returns immediately. If the user isn't authenticated, this function will authenticate the user with the authentication source, and then return the user to the current page. This function accepts an array $params, which controls some parts of the authentication. See the login() method for a description.
public requireAuth ( array $params = [] )
$params array Various options to the authentication request. See the documentation.