Пример #1
0
 /**
  * 
  * @param string $identity
  * @param string $credential
  * @return Result
  */
 public function login($identity, $credential)
 {
     $adapter = $this->authService->getAdapter();
     $adapter->setIdentity($identity);
     $adapter->setCredential($credential);
     return $this->authService->authenticate($adapter);
 }
Пример #2
0
 public function init()
 {
     $this->add(['name' => 'token', 'required' => true]);
     $this->add(['name' => 'identity', 'required' => true]);
     $this->add(['name' => 'credential', 'required' => true, 'validators' => [['name' => 'Zend\\Authentication\\Validator\\Authentication', 'options' => ['adapter' => $this->authenticationService->getAdapter(), 'service' => $this->authenticationService, 'identity' => 'identity', 'credential' => 'credential']]]]);
 }