コード例 #1
0
 @Override
 public boolean passwordValid(UserInfo userInfo, String j_password) {
   boolean passwordvalid = false;
   _log.info("password : "******"passwordvalid : " + passwordvalid);
   if (!passwordvalid) {
     setBadPasswordCount(userInfo);
     throw new BadCredentialsException("passwordvalid is " + passwordvalid);
   }
   return passwordvalid;
 }
コード例 #2
0
  protected User getUser() {
    if (user == null) {
      MessageDigestPasswordEncoder passwordEncoder =
          new MessageDigestPasswordEncoder("SHA-256", true);
      user = new User();
      user.setEmail("*****@*****.**");
      user.setFirstName("John");
      user.setLastName("Doe");
      user.setUsername("*****@*****.**");
      user.setPassword(passwordEncoder.encodePassword("1234", user.getEmail()));
      user.setActivationCode(UUID.randomUUID().toString());
      user.getUuid();

      userService.add(user);
    }

    return user;
  }