-
Notifications
You must be signed in to change notification settings - Fork 111
Open
Description
Extended from #733 , expanded into it's own issue as the previous is addressed.
Identifiers are now to be set per Authenticator.
But some Authenticators ask for an Identifier when they may not need one. For example, Form shouldn't need one if it's [username, password] as those are the default fields https://github.com/cakephp/authentication/blob/3.x/src/Authenticator/FormAuthenticator.php#L44 , so IMO the default Identifier should be Authentication.Password
.
This feels like it should be enough
public function getAuthenticationService(ServerRequestInterface $request): AuthenticationServiceInterface
{
$service = new AuthenticationService([
'unauthenticatedRedirect' => [
'prefix' => false,
'plugin' => null,
'controller' => 'Users',
'action' => 'login',
],
'queryParam' => 'redirect',
]);
// Load the authenticators. Session should be first.
$service->loadAuthenticator('Authentication.Session');
$service->loadAuthenticator('Authentication.Form');
return $service;
}
Rather than needing to do this:
public function getAuthenticationService(ServerRequestInterface $request): AuthenticationServiceInterface
{
$service = new AuthenticationService([
'unauthenticatedRedirect' => [
'prefix' => false,
'plugin' => null,
'controller' => 'Users',
'action' => 'login',
],
'queryParam' => 'redirect',
]);
// Load the authenticators. Session should be first.
$service->loadAuthenticator('Authentication.Session');
$service->loadAuthenticator('Authentication.Form', [
'identifier' => 'Authentication.Password',
]);
return $service;
}
Metadata
Metadata
Assignees
Labels
No labels