func (s *IdentityService) CheckPasswordWOToken(user string, password []byte) error {
	if err := services.VerifyPassword(password); err != nil {
		return trace.Wrap(err)
	}
	hash, err := s.GetPasswordHash(user)
	if err != nil {
		return trace.Wrap(err)
	}
	if err = s.IncreaseLoginAttempts(user); err != nil {
		return trace.Wrap(err)
	}
	if err := bcrypt.CompareHashAndPassword(hash, password); err != nil {
		return trace.BadParameter("passwords do not match")
	}
	defer s.ResetLoginAttempts(user)
	return nil
}
// CheckPasswordWOToken checks just password without checking HOTP tokens
// used in case of SSH authentication, when token has been validated
CheckPasswordWOToken checks just password without checking HOTP tokens
used in case of SSH authentication, when token has been validated
// CheckPasswordWOToken checks just password without checking HOTP tokens // used in case of SSH authentication when token has been validated
func (s *IdentityService) CheckPasswordWOToken(user string, password []byte) error {
	if err := services.VerifyPassword(password); err != nil {
		return trace.Wrap(err)
	}
	hash, err := s.GetPasswordHash(user)
	if err != nil {
		return trace.Wrap(err)
	}
	if err = s.IncreaseLoginAttempts(user); err != nil {
		return trace.Wrap(err)
	}
	if err := bcrypt.CompareHashAndPassword(hash, password); err != nil {
		return trace.BadParameter("passwords do not match")
	}
	defer s.ResetLoginAttempts(user)
	return nil
}
func ( s * IdentityService ) CheckPasswordWOToken ( user string , password [ ] byte ) error { if err := services . VerifyPassword ( password ) ; err != nil { return trace . Wrap ( err ) } hash , err := s . GetPasswordHash ( user ) if err != nil { return trace . Wrap ( err ) } if err = s . IncreaseLoginAttempts ( user ) ; err != nil { return trace . Wrap ( err ) } if err := bcrypt . CompareHashAndPassword ( hash , password ) ; err != nil { return trace . BadParameter ( " " ) } defer s . ResetLoginAttempts ( user ) return nil }
CheckPasswordWOToken checks just password without checking HOTP tokens
used in case of SSH authentication, when token has been validated
CheckPasswordWOToken checks just password without checking HOTP tokens used in case of SSH authentication when token has been validated