PHP Class FOF30\TransparentAuthentication\TransparentAuthentication

Afficher le fichier Open project: akeeba/fof Class Usage Examples

Protected Properties

Свойство Type Description
$authenticationMethods Enabled authentication methods, see the class constants
$basicAuthUsername The username required for the Auth_HTTPBasicAuth_TOTP method
$container The container we are attached to
$logoutOnExit Should I log out the user after the dispatcher exits?
$queryParam The query parameter for the Auth_QueryString_Plaintext method
$queryParamPassword The query parameter for the password in the Auth_SplitQueryString_Plaintext method
$queryParamUsername The query parameter for the username in the Auth_SplitQueryString_Plaintext method
$timeStep The time step for TOTP authentication
$totpKey The TOTP secret key

Méthodes publiques

Méthode Description
__construct ( Container $container, array $config = [] ) Public constructor.
addAuthenticationMethod ( integer $method ) Enable an authentication method
getAuthenticationMethods ( ) : array Get the enabled authentication methods
getBasicAuthUsername ( ) : string Get the required username for the HTTP Basic Authentication with TOTP method
getLogoutOnExit ( ) : boolean Should I log out when the dispatcher finishes?
getQueryParam ( ) : string Get the query parameter for the Auth_QueryString_TOTP method
getQueryParamPassword ( ) : string Get the query string for the password in the Auth_SplitQueryString_Plaintext method
getQueryParamUsername ( ) : string Get the query string for the username in the Auth_SplitQueryString_Plaintext method
getTimeStep ( ) : integer Get the time step in seconds for the TOTP in the Auth_HTTPBasicAuth_TOTP method
getTotpKey ( ) : string Get the secret key for the TOTP in the Auth_HTTPBasicAuth_TOTP method
getTransparentAuthenticationCredentials ( ) : array | null Tries to get the transparent authentication credentials from the request
removeAuthenticationMethod ( integer $method ) Disable an authentication method
setAuthenticationMethods ( array $authenticationMethods ) Set the enabled authentication methods
setBasicAuthUsername ( string $basicAuthUsername ) Set the required username for the HTTP Basic Authentication with TOTP method
setLogoutOnExit ( boolean $logoutOnExit ) Set the log out on exit flag (for testing)
setQueryParam ( string $queryParam ) Set the query parameter for the Auth_QueryString_TOTP method
setQueryParamPassword ( string $queryParamPassword ) Set the query string for the password in the Auth_SplitQueryString_Plaintext method
setQueryParamUsername ( string $queryParamUsername ) Set the query string for the username in the Auth_SplitQueryString_Plaintext method
setTimeStep ( integer $timeStep ) Set the time step in seconds for the TOTP in the Auth_HTTPBasicAuth_TOTP method
setTotpKey ( string $totpKey ) Set the secret key for the TOTP in the Auth_HTTPBasicAuth_TOTP method

Méthodes protégées

Méthode Description
parseAuthenticationMethods ( $methods ) : array Parses a list of transparent authentication methods (array or comma separated list of integers or method names) and converts it into an array of integers this class understands.

Private Methods

Méthode Description
decryptWithTOTP ( string $encryptedData ) : array Decrypts a transparent authentication message using a TOTP

Method Details

__construct() public méthode

The optional $config array can contain the following values (corresponding to the same-named properties of this class): timeStep, totpKey, cryptoKey, basicAuthUsername, queryParam, queryParamUsername, queryParamPassword, logoutOnExit. See the property descriptions for more information.
public __construct ( Container $container, array $config = [] )
$container FOF30\Container\Container
$config array

addAuthenticationMethod() public méthode

Enable an authentication method
public addAuthenticationMethod ( integer $method )
$method integer

getAuthenticationMethods() public méthode

Get the enabled authentication methods
public getAuthenticationMethods ( ) : array
Résultat array

getBasicAuthUsername() public méthode

Get the required username for the HTTP Basic Authentication with TOTP method
public getBasicAuthUsername ( ) : string
Résultat string

getLogoutOnExit() public méthode

Should I log out when the dispatcher finishes?
public getLogoutOnExit ( ) : boolean
Résultat boolean

getQueryParam() public méthode

Get the query parameter for the Auth_QueryString_TOTP method
public getQueryParam ( ) : string
Résultat string

getQueryParamPassword() public méthode

Get the query string for the password in the Auth_SplitQueryString_Plaintext method
public getQueryParamPassword ( ) : string
Résultat string

getQueryParamUsername() public méthode

Get the query string for the username in the Auth_SplitQueryString_Plaintext method
public getQueryParamUsername ( ) : string
Résultat string

getTimeStep() public méthode

Get the time step in seconds for the TOTP in the Auth_HTTPBasicAuth_TOTP method
public getTimeStep ( ) : integer
Résultat integer

getTotpKey() public méthode

Get the secret key for the TOTP in the Auth_HTTPBasicAuth_TOTP method
public getTotpKey ( ) : string
Résultat string

getTransparentAuthenticationCredentials() public méthode

Tries to get the transparent authentication credentials from the request

parseAuthenticationMethods() protected méthode

Parses a list of transparent authentication methods (array or comma separated list of integers or method names) and converts it into an array of integers this class understands.
protected parseAuthenticationMethods ( $methods ) : array
$methods
Résultat array

removeAuthenticationMethod() public méthode

Disable an authentication method
public removeAuthenticationMethod ( integer $method )
$method integer

setAuthenticationMethods() public méthode

Set the enabled authentication methods
public setAuthenticationMethods ( array $authenticationMethods )
$authenticationMethods array

setBasicAuthUsername() public méthode

Set the required username for the HTTP Basic Authentication with TOTP method
public setBasicAuthUsername ( string $basicAuthUsername )
$basicAuthUsername string

setLogoutOnExit() public méthode

Set the log out on exit flag (for testing)
public setLogoutOnExit ( boolean $logoutOnExit )
$logoutOnExit boolean

setQueryParam() public méthode

Set the query parameter for the Auth_QueryString_TOTP method
public setQueryParam ( string $queryParam )
$queryParam string

setQueryParamPassword() public méthode

Set the query string for the password in the Auth_SplitQueryString_Plaintext method
public setQueryParamPassword ( string $queryParamPassword )
$queryParamPassword string

setQueryParamUsername() public méthode

Set the query string for the username in the Auth_SplitQueryString_Plaintext method
public setQueryParamUsername ( string $queryParamUsername )
$queryParamUsername string

setTimeStep() public méthode

Set the time step in seconds for the TOTP in the Auth_HTTPBasicAuth_TOTP method
public setTimeStep ( integer $timeStep )
$timeStep integer

setTotpKey() public méthode

Set the secret key for the TOTP in the Auth_HTTPBasicAuth_TOTP method
public setTotpKey ( string $totpKey )
$totpKey string

Property Details

$authenticationMethods protected_oe property

Enabled authentication methods, see the class constants
protected $authenticationMethods

$basicAuthUsername protected_oe property

The username required for the Auth_HTTPBasicAuth_TOTP method
protected $basicAuthUsername

$container protected_oe property

The container we are attached to
protected $container

$logoutOnExit protected_oe property

Should I log out the user after the dispatcher exits?
protected $logoutOnExit

$queryParam protected_oe property

The query parameter for the Auth_QueryString_Plaintext method
protected $queryParam

$queryParamPassword protected_oe property

The query parameter for the password in the Auth_SplitQueryString_Plaintext method
protected $queryParamPassword

$queryParamUsername protected_oe property

The query parameter for the username in the Auth_SplitQueryString_Plaintext method
protected $queryParamUsername

$timeStep protected_oe property

The time step for TOTP authentication
protected $timeStep

$totpKey protected_oe property

The TOTP secret key
protected $totpKey