Sledgehammer Framework

HttpAuthentication extends Base
in package

Basic HTTP autentication.

Usage: $auth = new HttpAuthentication('Realm'); $credentials = $auth->authenticate();

Add a validation callback to resend authentication headers when invalid credentials are given. $auth = new HttpAuthentication('Realm', array('MyClass','login')); $credentials = $auth->authenticate();

Table of Contents

$realm  : string
WWW-Authenticate: realm=.
$validation  : callable
Callback for validating the given credentials.
__call()  : mixed
Report that the $method doesn't exist.
__callStatic()  : mixed
Report that the $method doesn't exist.
__construct()  : mixed
Constructor.
__get()  : mixed
Report that $property doesn't exist.
__set()  : mixed
Report that $property doesn't exist and set the property to the given $value.
__toString()  : string
The object is used as an string.
authenticate()  : array<string|int, mixed>|false
Return credentials or false and send login headers.
logout()  : mixed
Send HTTP login headers.

Properties

$validation

Callback for validating the given credentials.

private callable $validation

Methods

__call()

Report that the $method doesn't exist.

public __call(string $method, array<string|int, mixed> $arguments) : mixed
Parameters
$method : string
$arguments : array<string|int, mixed>
Return values
mixed

__callStatic()

Report that the $method doesn't exist.

public static __callStatic(string $method, array<string|int, mixed> $arguments) : mixed
Parameters
$method : string
$arguments : array<string|int, mixed>
Return values
mixed

__construct()

Constructor.

public __construct([string $realm = null ][, Closure|array<string|int, mixed> $validation = null ]) : mixed
Parameters
$realm : string = null
$validation : Closure|array<string|int, mixed> = null

Callback for validating the given credentials

Return values
mixed

__get()

Report that $property doesn't exist.

public __get(string $property) : mixed
Parameters
$property : string
Return values
mixed

__set()

Report that $property doesn't exist and set the property to the given $value.

public __set(string $property, mixed $value) : mixed
Parameters
$property : string
$value : mixed
Return values
mixed

__toString()

The object is used as an string.

public __toString() : string
Return values
string

authenticate()

Return credentials or false and send login headers.

public authenticate() : array<string|int, mixed>|false
Return values
array<string|int, mixed>|false

logout()

Send HTTP login headers.

public logout() : mixed
Return values
mixed

Search results