HTPasswd
Less than 1 minute
HTPasswd
.htpasswd file-backed authentication adapter.
class HTPasswd extends \Hazaar\Auth\AdapterExtends: Hazaar\Auth\Adapter
Users are looked up with Hazaar\Auth\Provider\HTPasswd, and their hashes are checked with Hazaar\Auth\Hasher\HTPasswd, which supports the formats htpasswd writes:
$apr1$(APR1-MD5){SHA}(SHA1)$2y$(bcrypt/blowfish)
The adapter also has helpers for creating, updating and deleting users in the file.
Methods
__construct
public __construct(Options $options = 'new Options()'): voidParameters
| Parameter | Type | Description |
|---|---|---|
$options | Hazaar\Auth\Adapter\HTPasswd\Options |
create
Creates a passwd file user record.
public create(string $identity, string $credential): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$identity | string | |
$credential | string |
update
Changes a user's password.
public update(string $identity, string $credential): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$identity | string | |
$credential | string |
delete
Deletes a user record from the passwd file.
public delete(string $identity): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$identity | string |
createProvider
protected createProvider(): UserProviderReturns: Hazaar\Auth\Interface\UserProvider
users
private users(): HTPasswdProviderReturns: Hazaar\Auth\Provider\HTPasswd
Generated by Hazaar API Doc Generator on Sun, 08 Nov 2026 03:36:15 +0000