AbstractAuth
in package
implements
AuthInterface
AbstractYes
Abstract auth class
Tags
Table of Contents
Interfaces
- AuthInterface
- Auth interface
Constants
Properties
- $password : string|null
- Authentication password
- $result : int
- Authentication result
- $username : string|null
- Authentication username
Methods
- authenticate() : int
- Method to authenticate
- getPassword() : string|null
- Get the password
- getResult() : int
- Get the authentication result
- getUsername() : string|null
- Get the username
- isAuthenticated() : bool
- Determine if the authentication attempt was successful
- setPassword() : AbstractAuth
- Set the password
- setUsername() : AbstractAuth
- Set the username
- verify() : bool
- Method to verify a password against a hash
Constants
NOT_VALID
Constant for auth result
public
int
NOT_VALID
= 0
VALID
public
mixed
VALID
= 1
Properties
$password
Authentication password
protected
string|null
$password
= null
$result
Authentication result
protected
int
$result
= 0
$username
Authentication username
protected
string|null
$username
= null
Methods
authenticate()
Method to authenticate
public
abstract authenticate(string $username, string $password) : int
Parameters
- $username : string
- $password : string
Return values
intgetPassword()
Get the password
public
getPassword() : string|null
Return values
string|nullgetResult()
Get the authentication result
public
getResult() : int
Return values
intgetUsername()
Get the username
public
getUsername() : string|null
Return values
string|nullisAuthenticated()
Determine if the authentication attempt was successful
public
isAuthenticated() : bool
Return values
boolsetPassword()
Set the password
public
setPassword(string $password) : AbstractAuth
Parameters
- $password : string
Return values
AbstractAuthsetUsername()
Set the username
public
setUsername(string $username) : AbstractAuth
Parameters
- $username : string
Return values
AbstractAuthverify()
Method to verify a password against a hash
public
verify(string $password, string $hash) : bool
Parameters
- $password : string
- $hash : string