AbstractAuth
in package
implements
AuthInterface
Abstract auth class
Tags
Interfaces, Classes and Traits
- AuthInterface
- Auth interface
Table of Contents
- NOT_VALID = 0
- Constant for auth result
- VALID = 1
- $password : string
- Authentication password
- $result : int
- Authentication result
- $username : string
- Authentication username
- authenticate() : int
- Method to authenticate
- getPassword() : string
- Get the password
- getResult() : int
- Get the authentication result
- getUsername() : string
- Get the username
- isValid() : bool
- Determine if the authentication attempt was valid
- 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
= ""
VALID
public
mixed
VALID
= 1
Properties
$password
Authentication password
protected
string
$password
= null
$result
Authentication result
protected
int
$result
= 0
$username
Authentication username
protected
string
$username
= null
Methods
authenticate()
Method to authenticate
public
abstract authenticate(string $username, string $password) : int
Parameters
- $username : string
- $password : string
Return values
int —getPassword()
Get the password
public
getPassword() : string
Return values
string —getResult()
Get the authentication result
public
getResult() : int
Return values
int —getUsername()
Get the username
public
getUsername() : string
Return values
string —isValid()
Determine if the authentication attempt was valid
public
isValid() : bool
Return values
bool —setPassword()
Set the password
public
setPassword(string $password) : AbstractAuth
Parameters
- $password : string
Return values
AbstractAuth —setUsername()
Set the username
public
setUsername(string $username) : AbstractAuth
Parameters
- $username : string
Return values
AbstractAuth —verify()
Method to verify a password against a hash
public
verify(string $password, string $hash) : bool
Parameters
- $password : string
- $hash : string