Authenticator
Less than 1 minute
Authenticator
class AuthenticatorProperties
backend
private Interface\Authenticator $backendType: Hazaar\Warlock\Server\Interface\Authenticator
Methods
__construct
public __construct(Options $options): voidParameters
| Parameter | Type | Description |
|---|---|---|
$options | Hazaar\Warlock\Server\Auth\Options |
authenticate
Authenticate a client using the provided credentials.
public authenticate(string $username, string $password, ?Client $client): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$username | string | the username provided by the client |
$password | string | the password provided by the client |
$client | Hazaar\Warlock\Server\Client | the client object requesting authentication (optional, may be used by some backends for context-aware authentication) |
exists
Check whether a user exists in the authentication database.
public exists(string $username): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$username | string | the username to check for existence |
addUser
Add a new user to the authentication database.
public addUser(string $username, string $password): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$username | string | the username for the new user (must be unique) |
$password | string | the password for the new user |
removeUser
Remove an existing user from the authentication database.
public removeUser(string $username): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$username | string | the username of the user to remove |
listUsers
List all users in the authentication database.
public listUsers(): arrayReturns: array
This method is optional and may not be supported by all backends. It can be used for administrative purposes.
Generated by Hazaar API Doc Generator on Fri, 04 Sep 2026 23:32:17 +0000