Java Code Examples for org.springframework.security.crypto.factory.PasswordEncoderFactories#createDelegatingPasswordEncoder()

The following examples show how to use org.springframework.security.crypto.factory.PasswordEncoderFactories#createDelegatingPasswordEncoder() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: InMemoryAuthWebSecurityConfigurer.java    From tutorials with MIT License 5 votes vote down vote up
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
    PasswordEncoder encoder = PasswordEncoderFactories.createDelegatingPasswordEncoder();        
    auth.inMemoryAuthentication()
        .passwordEncoder(encoder)
        .withUser("spring")
        .password(encoder.encode("secret"))            
        .roles("USER");
}
 
Example 2
Source File: WebSecurityConfigJWT.java    From quartz-manager with Apache License 2.0 5 votes vote down vote up
private void configureInMemoryAuthentication(AuthenticationManagerBuilder authenticationManagerBuilder) throws Exception {
  PasswordEncoder encoder = PasswordEncoderFactories.createDelegatingPasswordEncoder();
  if(inMemoryAccountProps.isEnabled() && inMemoryAccountProps.getUsers() != null && !inMemoryAccountProps.getUsers().isEmpty()) {
    InMemoryUserDetailsManagerConfigurer<AuthenticationManagerBuilder> inMemoryAuth = authenticationManagerBuilder.inMemoryAuthentication();
    inMemoryAccountProps.getUsers()
    .forEach(u -> inMemoryAuth
        .withUser(u.getName())
        .password(encoder.encode(u.getPassword()))
        .roles(u.getRoles().toArray(new String[0])));
  }
}
 
Example 3
Source File: BasicConfiguration.java    From tutorials with MIT License 5 votes vote down vote up
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
	PasswordEncoder encoder = PasswordEncoderFactories.createDelegatingPasswordEncoder();
	auth
      .inMemoryAuthentication()
      .withUser("user")
      .password(encoder.encode("password"))
      .roles("USER")
      .and()
      .withUser("admin")
      .password(encoder.encode("admin"))
      .roles("USER", "ADMIN");
}
 
Example 4
Source File: SecurityConfig.java    From streaming-file-server with MIT License 4 votes vote down vote up
@Bean
PasswordEncoder passwordEncoder() {
  return PasswordEncoderFactories.createDelegatingPasswordEncoder();
}
 
Example 5
Source File: WebSecurityConfig.java    From danyuan-application with Apache License 2.0 4 votes vote down vote up
@Bean
public PasswordEncoder passwordEncoder() {
	return PasswordEncoderFactories.createDelegatingPasswordEncoder();
}
 
Example 6
Source File: Beans.java    From zhcet-web with Apache License 2.0 4 votes vote down vote up
@Bean
public PasswordEncoder passwordEncoder() {
    return PasswordEncoderFactories.createDelegatingPasswordEncoder();
}
 
Example 7
Source File: SecurityConfig.java    From Microservices-with-Spring-Cloud with MIT License 4 votes vote down vote up
@Bean
public PasswordEncoder passwordEncoder() {
    return PasswordEncoderFactories.createDelegatingPasswordEncoder();
}
 
Example 8
Source File: WebSecurityConfiguration.java    From spring-cloud-demo with Apache License 2.0 4 votes vote down vote up
@Bean
PasswordEncoder passwordEncoder() {
    return PasswordEncoderFactories.createDelegatingPasswordEncoder();
}
 
Example 9
Source File: AuthServiceApplication.java    From spring-microservice-sample with GNU General Public License v3.0 4 votes vote down vote up
@Bean
public PasswordEncoder passwordEncoder() {
    return PasswordEncoderFactories.createDelegatingPasswordEncoder();
}
 
Example 10
Source File: SecurityConfiguration.java    From Spring-Boot-2-Fundamentals with MIT License 4 votes vote down vote up
@Bean
public PasswordEncoder passwordEncoder() {
    return PasswordEncoderFactories.createDelegatingPasswordEncoder();
}
 
Example 11
Source File: WebSecurityConfiguration.java    From microservices-oauth with Apache License 2.0 4 votes vote down vote up
@Bean
public PasswordEncoder passwordEncoder() {
	return PasswordEncoderFactories.createDelegatingPasswordEncoder();
}
 
Example 12
Source File: SecurityConfig.java    From spring-cloud-dataflow with Apache License 2.0 4 votes vote down vote up
@Bean
public PasswordEncoder passwordEncoder() {
	return PasswordEncoderFactories.createDelegatingPasswordEncoder();
}
 
Example 13
Source File: PostServiceApplication.java    From spring-microservice-sample with GNU General Public License v3.0 4 votes vote down vote up
@Bean
public PasswordEncoder passwordEncoder() {
    return PasswordEncoderFactories.createDelegatingPasswordEncoder();
}
 
Example 14
Source File: SecurityConfiguration.java    From bdf3 with Apache License 2.0 4 votes vote down vote up
@Bean
public PasswordEncoder standardPasswordEncoder() {
	return PasswordEncoderFactories.createDelegatingPasswordEncoder();
}
 
Example 15
Source File: BasicAuthSecurityConfiguration.java    From hawkbit-examples with Eclipse Public License 1.0 4 votes vote down vote up
@Bean
protected PasswordEncoder passwordEncoder() {
    return PasswordEncoderFactories.createDelegatingPasswordEncoder();
}
 
Example 16
Source File: WebSecurityConfig.java    From mall4j with GNU Affero General Public License v3.0 4 votes vote down vote up
@Bean
public PasswordEncoder passwordEncoder(){
    return PasswordEncoderFactories.createDelegatingPasswordEncoder();
}
 
Example 17
Source File: WebSecurityConfig.java    From spring-boot-demo with MIT License 4 votes vote down vote up
@Bean
PasswordEncoder passwordEncoder() {
    return PasswordEncoderFactories.createDelegatingPasswordEncoder();
}
 
Example 18
Source File: WebSecurityConfigurer.java    From smaker with GNU Lesser General Public License v3.0 2 votes vote down vote up
/**
 * https://spring.io/blog/2017/11/01/spring-security-5-0-0-rc1-released#password-storage-updated
 * Encoded password does not look like BCrypt
 *
 * @return PasswordEncoder
 */
@Bean
public PasswordEncoder passwordEncoder() {
	return PasswordEncoderFactories.createDelegatingPasswordEncoder();
}
 
Example 19
Source File: SecurityJwtConfiguration.java    From albedo with GNU Lesser General Public License v3.0 2 votes vote down vote up
/**
 * https://spring.io/blog/2017/11/01/spring-security-5-0-0-rc1-released#password-storage-updated
 * Encoded password does not look like BCrypt
 *
 * @return PasswordEncoder
 */
@Bean
public PasswordEncoder passwordEncoder() {
	return PasswordEncoderFactories.createDelegatingPasswordEncoder();
}
 
Example 20
Source File: SecurityAutoConfiguration.java    From albedo with GNU Lesser General Public License v3.0 2 votes vote down vote up
/**
 * https://spring.io/blog/2017/11/01/spring-security-5-0-0-rc1-released#password-storage-updated
 * Encoded password does not look like BCrypt
 *
 * @return PasswordEncoder
 */
@Bean
public PasswordEncoder passwordEncoder() {
	return PasswordEncoderFactories.createDelegatingPasswordEncoder();
}