Open citrususer4 opened 7 years ago
After many experiments, something happened. I do not know how much the right decision but it works
$adapter = $service->get('ZfcUser\Authentication\Adapter\AdapterChain');
$request = new \Zend\Http\Request();
$request->setMethod('POST');
$request->getPost()->set('identity', $identity)->set('credential', $credential);
$result = $adapter->prepareForAuthentication($request);
session_id($_SERVER['HTTP_PHPSESSID']);
$result = $auth->authenticate($adapter);
return $result->isValid();
This work good. But how to get adapter
$adapter = $auth->getAuthAdapter();
Call to undefined method Zend\Authentication\AuthenticationService::getAuthAdapter():