Authenticator

Class Rest\Authenticator Responsible for dealing with both Basic and Digest authentication

Methods

Rest\Authenticator constructor

__construct(\Rest\Rest\Server $rest = null) 

Arguments

$rest

\Rest\Rest\Server

Return internal Rest\Server object

getRest() : \Rest\Rest\Server

Response

\Rest\Rest\Server

Return user sent on BASIC Authentication

getUser() : string

Response

string

Return password sent for Authentication

getPassword() : string

Response

string

Return if is using digest authentication

isDigest() : bool

Response

bool

Set if authentication should be Digest(true)

forceDigest(bool $bool = true, string $realm = null) : \Rest\Rest\Authenticator

Arguments

$bool

bool

$realm

string

Response

\Rest\Rest\Authenticator

Get the http Realm name

getRealm() : string

Response

string

$realm

Set the http Realm name

setRealm(string $realm) : \Rest\RestAuthenticator

Arguments

$realm

string

Response

\Rest\RestAuthenticator

Sets if authentication is required

requireAuthentication($isRequired = true) : \Rest\RestAuthenticator

Arguments

$isRequired

Response

\Rest\RestAuthenticator

Checks if authenticated is required

isAuthenticationRequired() : bool

Response

bool

$auth;

Checks if is authenticated

isAuthenticated() : bool

Response

bool

$auth;

Sets authentication status

setAuthenticated($bool) : \Rest\Rest\Server

Arguments

$bool

Response

\Rest\Rest\Server

Test if user is authenticated, and set proper headers if not

tryAuthenticate() : bool

Response

bool

Test authentication against password for given username in Digest

validate(string $user, string $password) : \Rest\RestAuthenticator

Arguments

$user

string

$password

string

Response

\Rest\RestAuthenticator

Parse the digest auth message

digestParse($txt) : mixed

Arguments

$txt

Response

mixed

Digest header

digestHeader() : string

Response

string

Properties

rest

rest

user

user

pwd

pwd

authData

authData

realm

realm

isDigest

isDigest

requireAuth

requireAuth

auth

auth