Constants

NOT_VALID

NOT_VALID

Constant for auth result

VALID

VALID

Properties

$result

$result : integer

Authentication result

Type

integer

$username

$username : string

Authentication username

Type

string

$password

$password : string

Authentication password

Type

string

$uri

$uri : string

Auth URI

Type

string

$relativeUri

$relativeUri : string

Auth relative URI

Type

string

$method

$method : string

Auth method

Type

string

$type

$type : string

Auth type

Type

string

$scheme

$scheme : array

Scheme values

Type

array

$version

$version : string

HTTP version

Type

string

$code

$code : integer

Response code

Type

integer

$message

$message : string

Response message

Type

string

$headers

$headers : array

Response headers

Type

array

$body

$body : string

Response body

Type

string

Methods

getResult()

getResult() : integer

Get the authentication result

Returns

integer

isValid()

isValid() : boolean

Determine if the authentication attempt was valid

Returns

boolean

getUsername()

getUsername() : string

Get the username

Returns

string

getPassword()

getPassword() : string

Get the password

Returns

string

setUsername()

setUsername(string  $username) : \Pop\Auth\AbstractAuth

Set the username

Parameters

string $username

Returns

\Pop\Auth\AbstractAuth

setPassword()

setPassword(string  $password) : \Pop\Auth\AbstractAuth

Set the password

Parameters

string $password

Returns

\Pop\Auth\AbstractAuth

authenticate()

authenticate(string  $username, string  $password) : integer

Method to authenticate

Parameters

string $username
string $password

Returns

integer

__construct()

__construct(string  $uri, string  $method = 'GET') 

Constructor

Instantiate the Http auth adapter object

Parameters

string $uri
string $method

Throws

\Pop\Auth\Exception

getType()

getType() : string

Get the auth type

Returns

string

getScheme()

getScheme() : array

Get the auth scheme

Returns

array

getVersion()

getVersion() : string

Get the HTTP version

Returns

string

getCode()

getCode() : string

Get the HTTP code

Returns

string

getMessage()

getMessage() : string

Get the HTTP message

Returns

string

getHeaders()

getHeaders() : array

Get the HTTP response headers

Returns

array

getHeader()

getHeader(string  $name) : mixed

Get an HTTP response header

Parameters

string $name

Returns

mixed

getBody()

getBody() : string

Get the HTTP response body

Returns

string

generateRequest()

generateRequest() : void

Generate the request

parseScheme()

parseScheme(string  $wwwAuth) : void

Parse the scheme

Parameters

string $wwwAuth

decodeBody()

decodeBody(string  $body, string  $decode = 'gzip') : string

Decode the body data.

Parameters

string $body
string $decode

Throws

\Pop\Auth\Exception

Returns

string

decodeChunkedBody()

decodeChunkedBody(string  $body) : string

Decode a chunked transfer-encoded body and return the decoded text

Parameters

string $body

Returns

string

verify()

verify(string  $password, string  $hash) : \Pop\Auth\boolean;

Method to verify a password against a hash

Parameters

string $password
string $hash

Returns

\Pop\Auth\boolean;

sendRequest()

sendRequest(array  $context = null) : void

Send the request

Parameters

array $context