Skip to content

About

phpdb database table adapters for laminas-authentication.

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

phpdb-laminas-authentication

This library provides database table adapters for laminas/laminas-authentication that query through php-db/phpdb:

  • PhpDb\Authentication\Adapter\DbTable\CallbackCheckAdapter
  • PhpDb\Authentication\Adapter\DbTable\CredentialTreatmentAdapter

They are ports of laminas-authentication's laminas-db DbTable adapters, so moving an application from laminas-db to phpdb is mostly a namespace change. See Migrating from laminas-authentication for the differences.

Installation

Run the following to install this library:

$ composer require php-db/phpdb-laminas-authentication

Usage

use PhpDb\Authentication\Adapter\DbTable\CallbackCheckAdapter;

$authAdapter = new CallbackCheckAdapter(
    $dbAdapter, // a PhpDb\Adapter\AdapterInterface
    'users',
    'username',
    'password',
    static fn(string $hash, string $password): bool => password_verify($password, $hash),
);

$result = $authAdapter
    ->setIdentity($username)
    ->setCredential($password)
    ->authenticate();

Documentation

About

phpdb database table adapters for laminas-authentication.

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages