Constants

NOT_VALID

NOT_VALID

Constant for auth result

VALID

VALID

AUTH_BASIC

AUTH_BASIC

HTTP auth type constants

AUTH_DIGEST

AUTH_DIGEST

AUTH_BEARER

AUTH_BEARER

AUTH_DATA

AUTH_DATA

AUTH_REFRESH

AUTH_REFRESH

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

$bearerToken

$bearerToken : string

Auth bearer token

Type

string

$refreshToken

$refreshToken : string

Auth refresh token

Type

string

$refreshTokenName

$refreshTokenName : string

Auth refresh token name

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

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

verify()

verify(string  $password, string  $hash) : boolean

Method to verify a password against a hash

Parameters

string $password
string $hash

Returns

boolean

authenticate()

authenticate(string  $username, string  $password, array  $headers = null, array  $contextOptions = array(), array  $contextParams = null) : integer

Method to authenticate

Parameters

string $username
string $password
array $headers
array $contextOptions
array $contextParams

Returns

integer

__construct()

__construct(string  $uri, string  $method = 'POST', string  $type = null) 

Constructor

Instantiate the Http auth adapter object

Parameters

string $uri
string $method
string $type

setUri()

setUri(string  $uri) : \Pop\Auth\Http

Set the URI

Parameters

string $uri

Throws

\Pop\Auth\Exception

Returns

\Pop\Auth\Http

setRelativeUri()

setRelativeUri(string  $relativeUri) : \Pop\Auth\Http

Set the relative URI

Parameters

string $relativeUri

Returns

\Pop\Auth\Http

setBearerToken()

setBearerToken(string  $bearerToken) : \Pop\Auth\Http

Set the bearer token

Parameters

string $bearerToken

Returns

\Pop\Auth\Http

setRefreshToken()

setRefreshToken(string  $refreshToken) : \Pop\Auth\Http

Set the refresh token

Parameters

string $refreshToken

Returns

\Pop\Auth\Http

setRefreshTokenName()

setRefreshTokenName(string  $refreshTokenName) : \Pop\Auth\Http

Set the refresh token name

Parameters

string $refreshTokenName

Returns

\Pop\Auth\Http

setMethod()

setMethod(string  $method) : \Pop\Auth\Http

Set method

Parameters

string $method

Returns

\Pop\Auth\Http

setType()

setType(string  $type) : \Pop\Auth\Http

Set type

Parameters

string $type

Returns

\Pop\Auth\Http

getUri()

getUri() : string

Get the URI

Returns

string

getRelativeUri()

getRelativeUri() : string

Get the relative URI

Returns

string

getBearerToken()

getBearerToken() : string

Get the bearer token

Returns

string

getRefreshToken()

getRefreshToken() : string

Get the refresh token

Returns

string

getRefreshTokenName()

getRefreshTokenName() : string

Get the refresh token name

Returns

string

getType()

getType() : string

Get the auth type

Returns

string

getMethod()

getMethod() : string

Get method

Returns

string

getScheme()

getScheme() : array

Get the auth scheme

Returns

array

initRequest()

initRequest(string  $method) : void

Initialize the auth request

Parameters

string $method

validate()

validate(array  $headers = null, array  $contextOptions = array(), array  $contextParams = null) : integer

Method to validate authentication

Parameters

array $headers
array $contextOptions
array $contextParams

Returns

integer

parseScheme()

parseScheme(string  $wwwAuth) : string

Parse the scheme

Parameters

string $wwwAuth

Returns

string