Authentication Adapter authenticates using callback function.

The Callback function must return an identity on authentication success, and false on authentication failure.

package Default
inherited_from \Zend\Authentication\Adapter\AbstractAdapter

 Methods

__construct()

__construct(callable $callback = null

Parameters

$callback

callable

The authentication callback

Authenticate using the provided callback

authenticate() : \Zend\Authentication\Result

Exceptions

\Zend\Authentication\Exception\RuntimeException

Returns

\Zend\Authentication\ResultThe authentication result

Gets the value of callback.

getCallback() : null | callable

Returns

nullcallable

Returns the credential of the account being authenticated, or NULL if none is set.

getCredential() : mixed
Inherited
inherited_from \Zend\Authentication\Adapter\ValidatableAdapterInterface::getCredential()

Returns

mixed

Returns the identity of the account being authenticated, or NULL if none is set.

getIdentity() : mixed
Inherited
inherited_from \Zend\Authentication\Adapter\ValidatableAdapterInterface::getIdentity()

Returns

mixed

Sets the value of callback.

setCallback(callable $callback) 

Parameters

$callback

callable

the callback

Exceptions

\Zend\Authentication\Exception\InvalidArgumentException

Sets the credential for binding

setCredential(mixed $credential) : \Zend\Authentication\Adapter\AbstractAdapter
Inherited
inherited_from \Zend\Authentication\Adapter\ValidatableAdapterInterface::setCredential()

Parameters

$credential

mixed

Returns

\Zend\Authentication\Adapter\AbstractAdapter

Sets the identity for binding

setIdentity(mixed $identity) : \Zend\Authentication\Adapter\AbstractAdapter
Inherited
inherited_from \Zend\Authentication\Adapter\ValidatableAdapterInterface::setIdentity()

Parameters

$identity

mixed

Returns

\Zend\Authentication\Adapter\AbstractAdapter

 Properties

 

$callback

$callback : callable

Default

 

$credential

$credential : mixed

Default

 

$identity

$identity : mixed

Default