CakePHP 5 custom authentication, PasswordHasher

I would like know how to use it.

With Composer, it works, but I would like know how to use it without Composer.

Solution:

cd app
composer require "bordoni/phpass"

The file:

<?php
namespace App\Authentication\PasswordHasher;

use Authentication\PasswordHasher\AbstractPasswordHasher;
use Hautelook\Phpass\PasswordHash;

class PhpassPasswordHasher extends AbstractPasswordHasher {

  public function hash(string $password): string
  {
    $hasher = new PasswordHash( 8, true );
    return $hasher->HashPassword($password);
  }

  public function check(string $password, string $hashedPassword): bool
  {
    $hasher = new PasswordHash( 8, true );
    return $hasher->CheckPassword($password, $hashedPassword);
  }

}

The WordPress use this Phpass, that’s why I need it for my users table. It was a difficult birth. I have to study a lot. This PHP 8.3 with composer, “use”, “namespace” etc…