use of org.springframework.security.crypto.password.DelegatingPasswordEncoder in project terasoluna-tourreservation by terasolunaorg.
the class CustomerServiceImplTest method setUp.
@SuppressWarnings("unchecked")
@Before
public void setUp() throws Exception {
customerService = new CustomerServiceImpl();
customerRepository = mock(CustomerRepository.class);
customerService.customerRepository = customerRepository;
String encodingId = "pbkdf2";
Map<String, PasswordEncoder> encoders = new HashMap<>();
encoders.put("pbkdf2", new Pbkdf2PasswordEncoder());
encoders.put("bcrypt", new BCryptPasswordEncoder());
customerService.passwordEncoder = new DelegatingPasswordEncoder(encodingId, encoders);
sequencer = mock(Sequencer.class);
customerService.customerCodeSeq = sequencer;
}
use of org.springframework.security.crypto.password.DelegatingPasswordEncoder in project terasoluna-tourreservation-mybatis3 by terasolunaorg.
the class CustomerServiceImplTest method setUp.
@Before
public void setUp() throws Exception {
customerService = new CustomerServiceImpl();
customerRepository = mock(CustomerRepository.class);
customerService.customerRepository = customerRepository;
String encodingId = "pbkdf2";
Map<String, PasswordEncoder> encoders = new HashMap<>();
encoders.put("pbkdf2", new Pbkdf2PasswordEncoder());
encoders.put("bcrypt", new BCryptPasswordEncoder());
customerService.passwordEncoder = new DelegatingPasswordEncoder(encodingId, encoders);
}
use of org.springframework.security.crypto.password.DelegatingPasswordEncoder in project uaa by cloudfoundry.
the class PasswordEncoderConfig method nonCachingPasswordEncoder.
@Bean
public PasswordEncoder nonCachingPasswordEncoder() {
PasswordEncoder noopPasswordEncoder = new PasswordEncoder() {
@Override
public String encode(CharSequence rawPassword) {
return rawPassword.toString();
}
@Override
public boolean matches(CharSequence rawPassword, String encodedPassword) {
return rawPassword.toString().equals(encodedPassword);
}
};
logger.info("TEST CONTEXT - Building DelegatingPasswordEncoder with {bcrypt} and {noop} only");
Map<String, PasswordEncoder> encoders = new HashMap<>();
encoders.put("bcrypt", new BCryptPasswordEncoder());
encoders.put("noop", noopPasswordEncoder);
return new DelegatingPasswordEncoder("noop", encoders);
}
use of org.springframework.security.crypto.password.DelegatingPasswordEncoder in project tutorials by eugenp.
the class PasswordStorageWebSecurityConfigurer method passwordEncoder.
@Bean
public PasswordEncoder passwordEncoder() {
// set up the list of supported encoders and their prefixes
PasswordEncoder defaultEncoder = new StandardPasswordEncoder();
Map<String, PasswordEncoder> encoders = new HashMap<>();
encoders.put("bcrypt", new BCryptPasswordEncoder());
encoders.put("scrypt", new SCryptPasswordEncoder());
encoders.put("noop", NoOpPasswordEncoder.getInstance());
DelegatingPasswordEncoder passwordEncoder = new DelegatingPasswordEncoder("bcrypt", encoders);
passwordEncoder.setDefaultPasswordEncoderForMatches(defaultEncoder);
return passwordEncoder;
}
use of org.springframework.security.crypto.password.DelegatingPasswordEncoder in project OsmAnd-tools by osmandapp.
the class WebSecurityConfiguration method passwordEncoder.
@Bean
public PasswordEncoder passwordEncoder() {
DelegatingPasswordEncoder delegatingPasswordEncoder = (DelegatingPasswordEncoder) PasswordEncoderFactories.createDelegatingPasswordEncoder();
delegatingPasswordEncoder.setDefaultPasswordEncoderForMatches(new BCryptPasswordEncoder());
return delegatingPasswordEncoder;
}
Aggregations