Spork Code Libraries

AuthAdapter

Uses an authentication adapter to validate identity and credential values.

Extends
\Zend\Validator\AbstractValidator

Constants

IDENTITY_EMPTY

IDENTITY_EMPTY

CREDENTIAL_EMPTY

CREDENTIAL_EMPTY

Properties

$auth

$auth : \Zend\Authentication\AuthenticationService

Authentication service

Type

\Zend\Authentication\AuthenticationService

$authResult

$authResult : \Zend\Authentication\Result

Authentication result

Type

\Zend\Authentication\Result

$identity

$identity : string

Name of identity field

Type

string

$credential

$credential : string

Name of credential field

Type

string

$messageTemplates

$messageTemplates : array

List of validator message templates

Type

array

Methods

__construct()

__construct(\Zend\Authentication\AuthenticationService  $auth, string  $options = null) 

Initialize validator

Parameters

\Zend\Authentication\AuthenticationService $auth
string $options

Throws

\Exception

on authentication service does not have adapter

setIdentity()

setIdentity(string  $name) 

Set identity field name

Parameters

string $name

getIdentity()

getIdentity() : string

Get identity field name

Returns

string

setCredential()

setCredential(string  $name) 

Set credential field name

Parameters

string $name

getCredential()

getCredential() : string

Get credential field name

Returns

string

getAuthResult()

getAuthResult() : \Zend\Authentication\Result

Get the authentication result

Returns

\Zend\Authentication\Result

isValid()

isValid(mixed  $value, array  $context = null) : boolean

Test if authentication is valid

Parameters

mixed $value
array $context

Returns

boolean
See also