Http
extends AbstractAuth
in package
Uses
AdapterUserTrait
Http auth class
Tags
Table of Contents
Constants
Properties
- $client : Client
- Auth client
- $password : string|null
- Authentication password
- $passwordField : string
- Password field
- $result : int
- Authentication result
- $user : mixed
- User data
- $username : string|null
- Authentication username
- $usernameField : string
- Username field
Methods
- __construct() : mixed
- Constructor
- authenticate() : int
- Method to authenticate
- client() : Client
- Get client (alias method)
- getClient() : Client
- Get client
- getPassword() : string|null
- Get the password
- getPasswordField() : string
- Get the password field
- getResult() : int
- Get the authentication result
- getResultResponse() : mixed
- Get result response
- getUser() : mixed
- Get the user record
- getUsername() : string|null
- Get the username
- getUsernameField() : string
- Get the username field
- hasClient() : bool
- Has client
- isAuthenticated() : bool
- Determine if the authentication attempt was successful
- setClient() : Http
- Set client
- setPassword() : Http
- Set the password
- setPasswordField() : static
- Set the password field
- setUsername() : Http
- Set the username
- setUsernameField() : static
- Set the username field
- 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
$client
Auth client
protected
Client
$client
= null
$password
Authentication password
protected
string|null
$password
= null
$passwordField
Password field
protected
string
$passwordField
= 'password'
$result
Authentication result
protected
int
$result
= 0
$user
User data
protected
mixed
$user
= null
$username
Authentication username
protected
string|null
$username
= null
$usernameField
Username field
protected
string
$usernameField
= 'username'
Methods
__construct()
Constructor
public
__construct() : mixed
Instantiate the Http auth adapter object
authenticate()
Method to authenticate
public
authenticate([string|null $username = null ][, string|null $password = null ]) : int
Parameters
- $username : string|null = null
- $password : string|null = null
Return values
intclient()
Get client (alias method)
public
client() : Client
Return values
ClientgetClient()
Get client
public
getClient() : Client
Return values
ClientgetPassword()
Get the password
public
getPassword() : string|null
Return values
string|nullgetPasswordField()
Get the password field
public
getPasswordField() : string
Return values
stringgetResult()
Get the authentication result
public
getResult() : int
Return values
intgetResultResponse()
Get result response
public
getResultResponse() : mixed
getUser()
Get the user record
public
getUser() : mixed
getUsername()
Get the username
public
getUsername() : string|null
Return values
string|nullgetUsernameField()
Get the username field
public
getUsernameField() : string
Return values
stringhasClient()
Has client
public
hasClient() : bool
Return values
boolisAuthenticated()
Determine if the authentication attempt was successful
public
isAuthenticated() : bool
Return values
boolsetClient()
Set client
public
setClient(Client $client) : Http
Parameters
- $client : Client
Return values
HttpsetPassword()
Set the password
public
setPassword(string $password) : Http
Parameters
- $password : string
Return values
HttpsetPasswordField()
Set the password field
public
setPasswordField(string $passwordField) : static
Parameters
- $passwordField : string
Return values
staticsetUsername()
Set the username
public
setUsername(string $username) : Http
Parameters
- $username : string
Return values
HttpsetUsernameField()
Set the username field
public
setUsernameField(string $usernameField) : static
Parameters
- $usernameField : string
Return values
staticverify()
Method to verify a password against a hash
public
verify(string $password, string $hash) : bool
Parameters
- $password : string
- $hash : string