zendframework/zf2 — pull request #3420 by mwillbanks (2013-01-12 23:07:30+00:00)
Title: Authentication Validator

## Overview

The Authentication Validator implements a common validator that can be leveraged on forms and the like to be able to ease authentication. It utilizes the AuthenticationService internally providing much of the functionality.

### Usage

While the example below is explicit; you may specify the identity and credential as fields to be leveraged in the context. This allows for things like an InputFilter inside of a form to set the proper fields.

#### Explicit

```php
use Zend\Authentication\Validator\Authentication as AuthenticationValidator;
use Zend\Authentication\AuthenticationService;
use Zend\Authentication\Adapter\Ldap;

$validator = new AuthenticationValidator(
'adapter' => new Ldap(),
'service' => new AuthenticationService()
);
$validator->setIdentity('myidentity');
$validator->isValid('mycredential');
```

## Changes

All Authentication Adapters must now extend AbstractAdapter which implements a (set|get)Identity and (set|get)Credential. The adapters do not always have to leverage them such as the case with the Http adapter (which you would not leverage in this context). However, when using the validator the validator requires these columns to be utilized.