Authentication Validator

Introduction

Zend\Authentication\Validator\Authentication provides the ability to utilize a validator for an InputFilter in the instance of a Form or for single use where you simply want a true/false value and being able to introspect the error.

The available configuration options include:

  • adapter: This is an instance of Zend\Authentication\Adapter.
  • identity: This is the identity or name of the identity in the passed in context.
  • credential: This is the credential or the name of the credential in the passed in context.
  • service: This is an instance of Zend\Authentication\AuthenticationService

Basic Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
use Zend\Authentication\AuthenticationService;
use Zend\Authentication\Validator\Authentication as AuthenticationValidator;

$service = new AuthenticationService();
$adapter = new My\Authentication\Adapter();
$validator = new AuthenticationValidator(
    'service' => $service,
    'adapter' => $adapter,
);

$validator->setCredential('myCredentialContext');
$validator->isValid('myIdentity', array(
     'myCredentialContext' => 'myCredential',
));

Project Versions

Table Of Contents

Previous topic

LDAP Authentication

Next topic

Introduction

This Page

Edit this document

Edit this document

The source code of this file is hosted on GitHub. Everyone can update and fix errors in this document with few clicks - no downloads needed.

  1. Login with your GitHub account.
  2. Go to Authentication Validator on GitHub.
  3. Edit file contents using GitHub's text editor in your web browser
  4. Fill in the Commit message text box at the end of the page telling why you did the changes. Press Propose file change button next to it when done.
  5. On Send a pull request page you don't need to fill in text anymore. Just press Send pull request button.
  6. Your changes are now queued for review under project's Pull requests tab on GitHub.