PHP Класс FOF30\TransparentAuthentication\TransparentAuthentication

Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$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

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

Метод Описание
__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

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

Метод Описание
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.

Приватные методы

Метод Описание
decryptWithTOTP ( string $encryptedData ) : array Decrypts a transparent authentication message using a TOTP

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

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

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() публичный Метод

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

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

Get the enabled authentication methods
public getAuthenticationMethods ( ) : array
Результат array

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

Get the required username for the HTTP Basic Authentication with TOTP method
public getBasicAuthUsername ( ) : string
Результат string

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

Should I log out when the dispatcher finishes?
public getLogoutOnExit ( ) : boolean
Результат boolean

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

Get the query parameter for the Auth_QueryString_TOTP method
public getQueryParam ( ) : string
Результат string

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

Get the query string for the password in the Auth_SplitQueryString_Plaintext method
public getQueryParamPassword ( ) : string
Результат string

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

Get the query string for the username in the Auth_SplitQueryString_Plaintext method
public getQueryParamUsername ( ) : string
Результат string

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

Get the time step in seconds for the TOTP in the Auth_HTTPBasicAuth_TOTP method
public getTimeStep ( ) : integer
Результат integer

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

Get the secret key for the TOTP in the Auth_HTTPBasicAuth_TOTP method
public getTotpKey ( ) : string
Результат string

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

Tries to get the transparent authentication credentials from the request
public getTransparentAuthenticationCredentials ( ) : array | null
Результат array | null

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

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
Результат array

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Enabled authentication methods, see the class constants
protected $authenticationMethods

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

The username required for the Auth_HTTPBasicAuth_TOTP method
protected $basicAuthUsername

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

The container we are attached to
protected $container

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

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

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

The query parameter for the Auth_QueryString_Plaintext method
protected $queryParam

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

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

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

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

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

The time step for TOTP authentication
protected $timeStep

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

The TOTP secret key
protected $totpKey