예제 #1
0
파일: u2f.php 프로젝트: paul999/phpbb_2fa
 /**
  * Start of the login procedure.
  * @param int $user_id
  * @return array
  * @throws http_exception
  */
 public function login_start($user_id)
 {
     $registrations = json_encode($this->u2f->getAuthenticateData($this->getRegistrations($user_id)), JSON_UNESCAPED_SLASHES);
     $sql_ary = array('u2f_request' => $registrations);
     $count = $this->update_session($sql_ary);
     if ($count != 1) {
         // Reset sessions table.
         $sql_ary['u2f_request'] = '';
         $this->update_session($sql_ary);
         throw new http_exception(400, 'TFA_UNABLE_TO_UPDATE_SESSION');
     }
     $this->template->assign_var('U2F_REQ', $registrations);
     return array('S_TFA_INCLUDE_HTML' => '@paul999_tfa/tfa_u2f_authenticate.html');
 }
예제 #2
0
 /**
  * @expectedException \InvalidArgumentException
  * @expectedExceptionMessage $registrations of getAuthenticateData() method only accepts array of object.
  */
 public function testGetAuthenticateDataInvalidRegistrations2()
 {
     $regs = array('YubiKey NEO', 'YubiKey Standard');
     $data = $this->u2f->getAuthenticateData($regs);
 }