HTPasswd
Less than 1 minute
HTPasswd
Users stored in an Apache-style .htpasswd file, one identity:hash line per user.
class HTPasswd implements \Hazaar\Auth\Interface\UserProvider , \Hazaar\Auth\Interface\PasswordStore , \Hazaar\Auth\Interface\UserManager , \Hazaar\Auth\Interface\PasswordHasherAwareImplements: Hazaar\Auth\Interface\UserProvider, Hazaar\Auth\Interface\PasswordStore, Hazaar\Auth\Interface\UserManager, Hazaar\Auth\Interface\PasswordHasherAware
Hashes are checked with Hazaar\Auth\Hasher\HTPasswd, which understands the formats htpasswd writes.
Properties
options
private Options $optionsType: Hazaar\Auth\Provider\HTPasswd\Options
passwd
private string $passwdType: string
Methods
__construct
public __construct(array|Options $options): voidParameters
| Parameter | Type | Description |
|---|---|---|
$options | array | Hazaar\Auth\Provider\HTPasswd\Options |
findByIdentity
public findByIdentity(string $identity): ?IdentityReturns: Hazaar\Auth\Identity
Parameters
| Parameter | Type | Description |
|---|---|---|
$identity | string |
getPasswordHash
public getPasswordHash(string $identity): ?stringReturns: string
Parameters
| Parameter | Type | Description |
|---|---|---|
$identity | string |
setPasswordHash
public setPasswordHash(string $identity, string $hash): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$identity | string | |
$hash | string |
createUser
public createUser(string $identity, ?string $passwordHash, array $data): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$identity | string | |
$passwordHash | string | |
$data | array |
deleteUser
public deleteUser(string $identity): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$identity | string |
getPasswordHasher
public getPasswordHasher(): PasswordHasherReturns: Hazaar\Auth\Interface\PasswordHasher
read
private read(bool $mustExist): arrayReturns: array
Parameters
| Parameter | Type | Description |
|---|---|---|
$mustExist | bool |
write
private write(array $users): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$users | array | identity => hash |
Generated by Hazaar API Doc Generator on Wed, 28 Oct 2026 08:43:30 +0000