Authenticator
Less than 1 minute
Authenticator
class AuthenticatorProperties
public $Methods
__construct
public __construct(Options $options): voidParameters
| Parameter | Type | Description |
|---|---|---|
$options | Options |
authenticate
Authenticate a client using the provided credentials.
public authenticate(string $username, string $password, ?Client $client): boolParameters
| Parameter | Type | Description |
|---|---|---|
$username | string | the username provided by the client |
$password | string | the password provided by the client |
$client | 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): boolParameters
| 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): boolParameters
| 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): boolParameters
| Parameter | Type | Description |
|---|---|---|
$username | string | the username of the user to remove |
listUsers
List all users in the authentication database.
public listUsers(): voidThis 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, 05 Jun 2026 06:08:15 +0000