Package org.springframework.security.authentication.encoding

Examples of org.springframework.security.authentication.encoding.ShaPasswordEncoder.encodePassword()


    ShaPasswordEncoder passwordEncoder = new ShaPasswordEncoder();
    String salt = randomString.nextString();
    guest.salt = salt;
        if (guest.registrationMethod == Guest.RegistrationMethod.REGISTRATION_METHOD_FACEBOOK)
            guest.registrationMethod = Guest.RegistrationMethod.REGISTRATION_METHOD_FACEBOOK_WITH_PASSWORD;
    guest.password = passwordEncoder.encodePassword(password, salt);
  }

  @Override
  @Transactional(readOnly = false)
  public void setPassword(long guestId, String password) {
View Full Code Here


    @Override
    public boolean checkPassword(final long guestId, final String currentPassword) {
        Guest guest = getGuestById(guestId);
        ShaPasswordEncoder passwordEncoder = new ShaPasswordEncoder();
        String password = passwordEncoder.encodePassword(currentPassword, guest.salt);
        return password.equals(guest.password);
    }

    @Override
  public ResetPasswordToken getToken(String token) {
View Full Code Here

    } else if (args[0].equals("md5")) {
      PasswordEncoder encoder = new Md5PasswordEncoder();
      System.out.println(encoder.encodePassword(args[2], args[1]));
    } else if (args[0].equals("sha")) {
      PasswordEncoder encoder = new ShaPasswordEncoder();
      System.out.println(encoder.encodePassword(args[2], args[1]));
    } else if (args[0].equals("plaintext")) {
      PasswordEncoder encoder = new PlaintextPasswordEncoder();
      System.out.println(encoder.encodePassword(args[2], args[1]));
    } else {
      System.out.println("Algorithm must be md5, sha or plaintext");
View Full Code Here

    } else if (args[0].equals("sha")) {
      PasswordEncoder encoder = new ShaPasswordEncoder();
      System.out.println(encoder.encodePassword(args[2], args[1]));
    } else if (args[0].equals("plaintext")) {
      PasswordEncoder encoder = new PlaintextPasswordEncoder();
      System.out.println(encoder.encodePassword(args[2], args[1]));
    } else {
      System.out.println("Algorithm must be md5, sha or plaintext");
    }
  }
View Full Code Here

    private CustomerUserFacade cuFacade;

    @Override
    public UserDetails loadUserByUsername(String string) throws UsernameNotFoundException {
        ShaPasswordEncoder spe = new ShaPasswordEncoder();
        System.out.println(spe.encodePassword("rest", "rest"));
        //
        CustomUserDetails d = new CustomUserDetails();
        if (string.equals(adminUsername)) {
            d.setIsAdmin(Boolean.TRUE);
            d.setAuthorities(Arrays.asList(createRole("ROLE_ADMIN")));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.