Constants

NOT_VALID

NOT_VALID = 0 : integer

Constant for auth result

VALID

VALID = 1

AUTH_BASIC

AUTH_BASIC = 'BASIC'

HTTP auth type constants

AUTH_DIGEST

AUTH_DIGEST = 'DIGEST'

AUTH_BEARER

AUTH_BEARER = 'BEARER'

AUTH_URL_DATA

AUTH_URL_DATA = 'URL_DATA'

AUTH_FORM_DATA

AUTH_FORM_DATA = 'FORM_DATA'

AUTH_REFRESH

AUTH_REFRESH = 'REFRESH'

Properties

$result

$result : integer

Authentication result

Type

integer

$username

$username : string

Authentication username

Type

string

$password

$password : string

Authentication password

Type

string

$contentType

$contentType : string

Auth content type

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

$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 = array(), array  $contextOptions = array(), array  $contextParams = array()) : integer

Method to authenticate

Parameters

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

Returns

integer

__construct()

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

Constructor

Instantiate the Http auth adapter object

Parameters

mixed $stream
string $type
string $method

setContentType()

setContentType(string  $contentType) : \Pop\Auth\Http

Set content type

Parameters

string $contentType

Returns

\Pop\Auth\Http

setContentTypeAsUrlForm()

setContentTypeAsUrlForm() : \Pop\Auth\Http

Set content type as URL form

Returns

\Pop\Auth\Http

setContentTypeAsMultipartForm()

setContentTypeAsMultipartForm() : \Pop\Auth\Http

Set content type as multipart form

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

setType()

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

Set type

Parameters

string $type

Returns

\Pop\Auth\Http

getResultResponse()

getResultResponse() : array

Get result response

Returns

array

getContentType()

getContentType() : string

Get content type

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

getScheme()

getScheme() : array

Get the auth scheme

Returns

array

hasStream()

hasStream() : boolean

Has stream

Returns

boolean

hasContentType()

hasContentType() : boolean

Has content type

Returns

boolean

hasBearerToken()

hasBearerToken() : boolean

Has bearer token

Returns

boolean

hasRefreshToken()

hasRefreshToken() : boolean

Has refresh token

Returns

boolean

hasRefreshTokenName()

hasRefreshTokenName() : boolean

Has refresh token name

Returns

boolean

hasType()

hasType() : boolean

Has auth type

Returns

boolean

hasScheme()

hasScheme() : boolean

Has an auth scheme

Returns

boolean

initRequest()

initRequest() : void

Initialize the auth request

Throws

\Pop\Auth\Exception

validate()

validate(array  $headers = array(), array  $contextOptions = array(), array  $contextParams = array()) : 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

createDigest()

createDigest() : string

Create auth digest header string

Throws

\Pop\Auth\Exception

Returns

string