I'm reporting a regression found in the cakephp/authentication plugin, specifically version 3.3.3. Version 3.3.2 works as expected.
The configuration for the OrmResolver is correctly passed to AuthenticationService::loadIdentifier(), but the nested keys ('userModel', 'finder') are stripped or lost when the PasswordIdentifier is initialized, causing the OrmResolver to fall back to its default model, 'Users', instead of the intended one, e.g., 'Members'.
This prevents any non-default user model from being authenticated.
The following configuration, designed to use the 'Members' model:
$service->loadIdentifier('Authentication.Password', [
'resolver' => [
'className' => 'Authentication.Orm',
'userModel' => 'Members', // This configuration is lost in 3.3.3
'finder' => 'all',
],
'fields' => ['username' => 'email', 'password' => 'password'],
]);
Output from AuthenticationService::loadIdentifier() (Configuration is correct):
'Authentication.Password'
[
'resolver' => [
'className' => 'Authentication.Orm',
'userModel' => 'Members', // Correctly present here
'finder' => 'all',
],
// ...
]
Output from OrmResolver::__construct() (Configuration is lost):
// Contents of $config array received by OrmResolver::__construct()
[
'className' => 'Authentication.Orm', // Only this key remains
]
CakePHP version: 5.2.9
Authentication version: 3.3.3 (not working)
Authentication version: 3.3.2 (working)