Authentication Validator

Zend\Authentication\Validator\Authentication provides a zend-validator ValidatorInterface implementation, which can be used within an input filter or form, or anywhere you you simply want a true/false value to determine whether or not authentication credentials were provided.

The available configuration options include:


use My\Authentication\Adapter;
use Zend\Authentication\AuthenticationService;
use Zend\Authentication\Validator\Authentication as AuthenticationValidator;

$service   = new AuthenticationService();
$adapter   = new Adapter();
$validator = new AuthenticationValidator([
    'service' => $service,
    'adapter' => $adapter,

$validator->isValid('myIdentity', [
     'myCredentialContext' => 'myCredential',