/**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable  $user
  * @param  array  $credentials
  * @return bool
  */
 public function validateCredentials(UserContract $user, array $credentials)
 {
     $plain = $credentials['password'];
     $options = array();
     if ($user instanceof User) {
         $options['salt'] = $user->salt;
         $options['byte_size'] = strlen($user->getAuthPassword());
     }
     return $this->hasher->check($plain, $user->getAuthPassword(), $options);
 }
 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable  $user
  * @param  array  $credentials
  * @return bool
  */
 public function validateCredentials(UserContract $user, array $credentials)
 {
     $plain = $credentials['password'];
     $legacyHasher = $user->getAuthObject();
     if ($legacyHasher !== false) {
         if (!$legacyHasher->check($plain, $user->getAuthPassword())) {
             return false;
         }
         $user->password = $this->hasher->make($plain);
         $user->password_legacy = null;
         $user->save();
         return true;
     }
     return $this->hasher->check($plain, $user->getAuthPassword());
 }
 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable  $user
  * @param  array  $credentials
  * @return bool
  */
 public function validateCredentials(Authenticatable $user, array $credentials)
 {
     $plain = $credentials['password'];
     $laravel = $this->hasher->check($plain, $user->getAuthPassword());
     if ($laravel) {
         return true;
     }
     $django = $this->hasher->checkForDjango($plain, $user->getAuthPassword());
     if ($django) {
         if (config('auth.rehash_django', true)) {
             $this->updatePassword($user, $plain);
         }
         return true;
     }
     return false;
 }
 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable $user
  * @param  array $credentials
  * @return bool
  */
 public function validateCredentials(Authenticatable $user, array $credentials)
 {
     if (!isset($credentials['password'])) {
         return false;
     }
     return $user->getAuthPassword() === $credentials['password'];
 }
 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable  $user
  * @param  array  $credentials
  * @return bool
  */
 public function validateCredentials(Authenticatable $user, array $credentials)
 {
     // $is_valid = $this->model->where('Username', '=', $credentials['Username'])->where('Password', '=', $credentials['Password'])->first() != null;
     $is_valid = $user->Username == $credentials['Username'] && $this->hasher->check($credentials['Password'], $user->getAuthPassword());
     return $is_valid;
     // $plain = $credentials['password'];
     // return $this->hasher->check($plain, $user->getAuthPassword());
 }
 /**
  * @param Authenticatable $user
  * @param array $credentials
  * @return bool
  */
 public function validateCredentials(Authenticatable $user, array $credentials)
 {
     if ($user->type == 'local') {
         $plain = $credentials['password'];
         return $this->hasher->check($plain, $user->getAuthPassword());
     }
     return true;
 }
 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable $user
  * @param  array $credentials
  * @return bool
  */
 public function validateCredentials(Authenticatable $user, array $credentials)
 {
     if ($user instanceof CustomKeyAuthenticable) {
         $method = 'get' . ucfirst($user->getAuthKeyName());
     } else {
         $method = 'getEmail';
     }
     return app('hash')->check($credentials['password'], $user->getAuthPassword()) && trim(strtolower($credentials['email'])) === trim(strtolower($user->{$method}()));
 }
 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Auth\UserInterface  $user
  * @param  array  $credentials
  * @return bool
  */
 public function validateCredentials(\Illuminate\Contracts\Auth\Authenticatable $user, array $credentials)
 {
     $plain = $credentials['password'];
     return $this->hasher->check($plain, $user->getAuthPassword());
 }
 /**
  * Validate a user against the given credentials.
  *
  * @param \Illuminate\Contracts\Auth\Authenticatable $user
  * @param array                                      $credentials
  *
  * @return bool
  */
 public function validateCredentials(AuthenticatableContract $user, array $credentials)
 {
     return $this->hasher->check($credentials['password'], $user->getAuthPassword());
 }
 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable $user
  * @param  array $credentials
  * @return bool
  */
 public function validateCredentials(Authenticatable $user, array $credentials)
 {
     $plain = $credentials['password'];
     return $this->hasher->check($plain, $this->hasher->make($user->getAuthPassword()));
 }
 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable $user
  * @param  array $credentials
  * @return bool
  */
 public function validateCredentials(Authenticatable $user, array $credentials)
 {
     $password = $credentials[$this->getPasswordField()];
     return $this->hasher->check($password, $user->getAuthPassword());
 }
 public function validateCredentials(UserContract $user, array $credentials)
 {
     $userPass = $user->getAuthPassword();
     $pass = $credentials['password'];
     return password_verify($pass, $userPass);
 }
 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable $user
  * @param  array                                      $credentials
  *
  * @return bool
  */
 public function validateCredentials(Authenticatable $user, array $credentials)
 {
     $pwmatch = FALSE;
     $hash = $user->getAuthPassword();
     if ($this->hash_password) {
         if ($this->log_logins) {
             Log::debug('login.validatecreds.hashpw', ['username_clean' => strtolower($credentials['username'])]);
         }
         //Check if hash is a bcryp 2 hash, then use bcrypt2
         if (strncmp($hash, '$2y$10$', 7) == 0) {
             $pwmatch = Hash::check($credentials['password'], $hash);
             if ($this->log_logins) {
                 Log::debug('login.validatecreds.newhash', ['username_clean' => strtolower($credentials['username'])]);
             }
         } else {
             $passwordhash = new PasswordHash();
             $pwmatch = $passwordhash->phpbb_check_hash($credentials['password'], $user->getAuthPassword());
             if ($this->log_logins) {
                 Log::debug('login.validatecreds.oldhash', ['username_clean' => strtolower($credentials['username'])]);
             }
         }
     } else {
         if ($this->log_logins) {
             Log::debug('login.validatecreds.nohash', ['username_clean' => strtolower($credentials['username'])]);
         }
         $pwmatch = $credentials['password'] == $hash;
     }
     if ($user->username_clean == strtolower($credentials['username']) && $pwmatch == TRUE) {
         if ($this->log_logins) {
             Log::debug('login.validatecreds.success', ['username_clean' => strtolower($credentials['username'])]);
         }
         return TRUE;
     }
     if ($this->log_logins) {
         Log::debug('login.validatecreds.fail', ['username_clean' => strtolower($credentials['username'])]);
     }
     return FALSE;
 }
 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable  $user
  * @param  array  $credentials
  * @return bool
  */
 public function validateCredentials(UserContract $user, array $credentials)
 {
     $plain = $credentials['password'];
     return $this->hasher->check($plain, $user->getAuthPassword());
 }
 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable $user
  * @param  array $credentials
  * @return bool
  */
 public function validateCredentials(Authenticatable $user, array $credentials)
 {
     $plain = $credentials['password'];
     if ($this->hasher->check($plain, $user->getAuthPassword())) {
         //            $user->last_login_time = Carbon::now();
         //            $user->save();
         return true;
     }
     return false;
 }
 /**
  * @inheritdoc
  */
 public function validateCredentials(Authenticatable $user, array $credentials)
 {
     /** @noinspection PhpUndefinedMethodInspection */
     return Hash::check($credentials['password'], $user->getAuthPassword());
 }
 /**
  * Processes Validation and fix results based on options
  * @param UserContract $user
  * @param string $password
  * @param bool $adResult
  * @return bool
  */
 private function processResult(UserContract $user, $password, $adResult)
 {
     if ($this->adAuthDBFallback && !$adResult && \Hash::check($password, $user->getAuthPassword())) {
         return true;
     }
     return $adResult;
 }
Beispiel #18
0
 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable $user
  * @param  array $credentials
  * @return bool
  */
 public function validateCredentials(UserContract $user, array $credentials)
 {
     if (!$user->getAuthPassword()) {
         return false;
     }
     if (Hash::check($credentials['password'], $user->getAuthPassword())) {
         return true;
     } else {
         return false;
     }
 }
 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Auth\Authenticatable $user
  * @param  array $credentials
  * @return bool
  */
 public function validateCredentials(Authenticatable $user, array $credentials)
 {
     return $credentials['type'] === 'shibboleth' ? true : $this->hasher->check($credentials['password'], $user->getAuthPassword());
 }
Beispiel #20
0
 /**
  * 覆盖原方法,验证用户密码
  */
 public function validateCredentials(UserContract $user, array $credentials)
 {
     $plain = $credentials['mm'];
     $authPassword = $user->getAuthPassword();
     return $authPassword === $plain;
 }
Beispiel #21
0
 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable  $user
  * @param  array  $credentials
  * @return bool
  */
 public function validateCredentials(Authenticatable $user, array $credentials)
 {
     return Hash::make($credentials['password']) == $user->getAuthPassword();
 }
Beispiel #22
0
 /**
  * Validate a user against the given credentials.
  *
  * @param \Illuminate\Contracts\Auth\Authenticatable $user
  * @param array $credentials
  * @return bool
  */
 public function validateCredentials(Authenticatable $user, array $credentials)
 {
     $password = $user->getAuthPassword();
     if (password_verify($credentials['password'], $password)) {
         return true;
     }
     // 不正なパスワード
     return false;
 }
 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable $user
  * @param  array $credentials
  * @return bool
  */
 public function validateCredentials(UserContract $user, array $credentials)
 {
     foreach ($credentials as $fieldName => $value) {
         if (is_string($fieldName) && !is_numeric($fieldName)) {
             if ($fieldName === 'password') {
                 if (!Hash::check($value, $user->getAuthPassword())) {
                     return false;
                 }
             } else {
                 if ($user->{$fieldName} != $value) {
                     return false;
                 }
             }
         }
     }
     return true;
 }
 /**
  * Check user password
  *
  * @param Authenticatable $user
  * @param array $credentials
  * @return bool
  */
 public function validateCredentials(Authenticatable $user, array $credentials)
 {
     $credentials['password'] = mysqlHash($credentials['password']);
     return $user->getAuthPassword() == $credentials['password'];
 }
Beispiel #25
0
 /**
  * Check if passwords match
  * @param  Authenticatable $user
  * @param  string          $password
  * @return boolean
  */
 protected function checkPassword(Authenticatable $user, $password)
 {
     return app('hash')->check($password, $user->getAuthPassword());
 }
 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable  $user
  * @param  array  $credentials
  * @return bool
  */
 public function validateCredentials(Authenticatable $user, array $credentials)
 {
     $plain = $credentials['clave'];
     return md5($plain) == $user->getAuthPassword();
 }
Beispiel #27
0
 public function validateCredentials(UserContract $user, array $credentials)
 {
     return $user->getAuthPassword() === $credentials['mm'];
 }
 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable $user
  * @param  array $credentials
  * @throws \ErrorException
  * @return bool
  */
 public function validateCredentials(Authenticatable $user, array $credentials)
 {
     if (!array_key_exists('password', $credentials) || !$credentials['password']) {
         throw new ErrorException('Missing credential: "password"');
     }
     return str_is($credentials['password'], $user->getAuthPassword());
 }
Beispiel #29
0
 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Auth\UserInterface  $user
  * @param  array  $credentials
  * @return bool
  */
 public function validateCredentials(AuthenticatableInterface $user, array $credentials)
 {
     $plain = $credentials['password'];
     $authPassword = $user->getAuthPassword();
     $credentials[$this->netidKey] = strtolower($credentials[$this->netidKey]);
     if (!empty($authPassword)) {
         return $this->hasher->check($plain, $authPassword);
     }
     $result = $this->validateLdapCredentials($credentials);
     return $result;
 }
 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable  $user
  * @param  array  $credentials
  * @return bool
  */
 public function validateCredentials(UserContract $user, array $credentials)
 {
     $credentialsValidated = false;
     // If the user is set AND, either of auth_type 'internal' or with
     // auth_type unset or null, then validate against the stored
     // password hash. Otherwise if the LDAP authentication
     // method is enabled, try it.
     if (isset($user) && (isset($user->auth_type) && $this->ldapConfig['label_internal'] === $user->auth_type || !isset($user->auth_type))) {
         $plain = $credentials['password'];
         $credentialsValidated = $this->hasher->check($plain, $user->getAuthPassword());
     } else {
         if ($this->ldapConfig['enabled'] && $this->ldapConfig['label_ldap'] === $user->auth_type) {
             // Validate credentials against LDAP/AD server.
             $credentialsValidated = $this->validateLDAPCredentials($credentials);
             // If validated and config set to resync group membership on login.
             if ($credentialsValidated && $this->ldapConfig['resync_on_login']) {
                 // First, revoke membership to all groups marked to 'resync_on_login'.
                 $this->revokeMembership($user);
                 // Then replicate group membership.
                 $this->replicateMembershipFromLDAP($user);
             }
         }
     }
     return $credentialsValidated;
 }