HTTP Authentication File Resolver

 Methods

Constructor

__construct(string $path) 

Parameters

$path

string

Complete filename where the credentials are stored

Returns the path to the credentials file

getFile() : string

Returns

string

Resolve credentials

resolve(string $username, string $realm, $password) : string | false

Only the first matching username/realm combination in the file is returned. If the file contains credentials for Digest authentication, the returned string is the password hash, or h(a1) from RFC 2617. The returned string is the plain-text password for Basic authentication.

The expected format of the file is: username:realm:sharedSecret

That is, each line consists of the user's username, the applicable authentication realm, and the password or hash, each delimited by colons.

Parameters

$username

string

Username

$realm

string

Authentication Realm

$password

Exceptions

\Zend\Authentication\Adapter\Http\Exception\ExceptionInterface

Returns

stringfalseUser's shared secret, if the user is found in the realm, false otherwise.

Set the path to the credentials file

setFile(string $path) : \Zend\Authentication\Adapter\Http\FileResolver

Parameters

$path

string

Exceptions

\Zend\Authentication\Adapter\Http\Exception\InvalidArgumentException if path is not readable

Returns

 Properties

 

Path to credentials file

$file : string