Java Code Examples for org.springframework.security.crypto.password.NoOpPasswordEncoder#getInstance()

The following examples show how to use org.springframework.security.crypto.password.NoOpPasswordEncoder#getInstance() . 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: InMemoryAuthenticationProviderConfiguration.java    From gravitee-management-rest-api with Apache License 2.0 6 votes vote down vote up
@Bean
public PasswordEncoder passwordEncoder() {
  String encodingAlgo = environment.getProperty(ENCODING_ALGORITHM_PROPERTY_NAME, BCRYPT_ALGORITHM);
  if ( encodingAlgo == null || encodingAlgo.isEmpty() ) {
    encodingAlgo = BCRYPT_ALGORITHM;
  }
  switch (encodingAlgo.toLowerCase()) {
  case BCRYPT_ALGORITHM:
    return new BCryptPasswordEncoder();
  case NOOP_ALGORITHM:
    return NoOpPasswordEncoder.getInstance();
  default:
    throw new IllegalArgumentException("Unsupported password encoding algorithm : " + encodingAlgo);
  }

}
 
Example 2
Source File: PasswordEncoderFactoriesTest.java    From spring-boot-demo with MIT License 5 votes vote down vote up
public static PasswordEncoder newPasswordEncoder(final String encoderType) {

        switch (encoderType) {
            case "bcrypt":
                return new BCryptPasswordEncoder();
            case "ldap":
                return new org.springframework.security.crypto.password.LdapShaPasswordEncoder();
            case "MD4":
                return new org.springframework.security.crypto.password.Md4PasswordEncoder();
            case "MD5":
                return new org.springframework.security.crypto.password.MessageDigestPasswordEncoder("MD5");
            case "noop":
                return org.springframework.security.crypto.password.NoOpPasswordEncoder.getInstance();
            case "pbkdf2":
                return new Pbkdf2PasswordEncoder();
            case "scrypt":
                return new SCryptPasswordEncoder();
            case "SHA-1":
                return new org.springframework.security.crypto.password.MessageDigestPasswordEncoder("SHA-1");
            case "SHA-256":
                return new org.springframework.security.crypto.password.MessageDigestPasswordEncoder("SHA-256");
            case "sha256":
                return new org.springframework.security.crypto.password.StandardPasswordEncoder();
            default:
                return NoOpPasswordEncoder.getInstance();
        }
    }
 
Example 3
Source File: Oauth20AutoConfiguration.java    From MaxKey with Apache License 2.0 5 votes vote down vote up
/**
 * ProviderManager. 
 * @return oauth20ClientAuthenticationManager
 */
@Bean(name = "oauth20ClientAuthenticationManager")
public ProviderManager oauth20ClientAuthenticationManager(
        ClientDetailsUserDetailsService oauth20ClientDetailsUserService
        ) {
    DaoAuthenticationProvider daoAuthenticationProvider= new DaoAuthenticationProvider();
    PasswordEncoder passwordEncoder = NoOpPasswordEncoder.getInstance();
    daoAuthenticationProvider.setPasswordEncoder(passwordEncoder);
    daoAuthenticationProvider.setUserDetailsService(oauth20ClientDetailsUserService);
    ProviderManager clientAuthenticationManager = new ProviderManager(daoAuthenticationProvider);
    return clientAuthenticationManager;
}
 
Example 4
Source File: SecurityConfig.java    From spring-5-examples with MIT License 4 votes vote down vote up
@Bean PasswordEncoder passwordEncoder() {
  return NoOpPasswordEncoder.getInstance();
}
 
Example 5
Source File: WebSecurityConfig.java    From Mastering-Microservices-with-Java-Third-Edition with MIT License 4 votes vote down vote up
@Bean
public PasswordEncoder encoder() {
  return NoOpPasswordEncoder.getInstance();
}
 
Example 6
Source File: OAuth2AutoConfigurationTests.java    From spring-security-oauth2-boot with Apache License 2.0 4 votes vote down vote up
@Bean
public static PasswordEncoder passwordEncoder() {
	return NoOpPasswordEncoder.getInstance();
}
 
Example 7
Source File: WebSecurityConfig.java    From metron with Apache License 2.0 4 votes vote down vote up
@Bean
public PasswordEncoder passwordEncoder() {
    return NoOpPasswordEncoder.getInstance();
}
 
Example 8
Source File: WebSecurityConfig.java    From spring-cloud-docker-microservice-book-code with Apache License 2.0 4 votes vote down vote up
@Bean
public PasswordEncoder passwordEncoder() {
  // 明文编码器。这是一个不做任何操作的密码编码器,是Spring提供给我们做明文测试的。
  // A password encoder that does nothing. Useful for testing where working with plain text
  return NoOpPasswordEncoder.getInstance();
}
 
Example 9
Source File: SecurityConfiguration.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@Bean
public static NoOpPasswordEncoder passwordEncoder() {
    return (NoOpPasswordEncoder) NoOpPasswordEncoder.getInstance();
}
 
Example 10
Source File: AbstractSecurityConfig.java    From freeacs with MIT License 4 votes vote down vote up
@Bean
public PasswordEncoder passwordEncoder() {
    return NoOpPasswordEncoder.getInstance();
}
 
Example 11
Source File: AuthorizationApplication.java    From Spring with Apache License 2.0 4 votes vote down vote up
@Bean
PasswordEncoder noOpPasswordEncoder() {
	return NoOpPasswordEncoder.getInstance();
}
 
Example 12
Source File: ActuatorSecurityConfig.java    From spring-in-action-5-samples with Apache License 2.0 4 votes vote down vote up
@Bean
public PasswordEncoder passwordEncoder() {
  return NoOpPasswordEncoder.getInstance();
}
 
Example 13
Source File: ActuatorSecurityConfig.java    From spring-in-action-5-samples with Apache License 2.0 4 votes vote down vote up
@Bean
public PasswordEncoder passwordEncoder() {
  return NoOpPasswordEncoder.getInstance();
}
 
Example 14
Source File: SecurityConfig.java    From spring-in-action-5-samples with Apache License 2.0 4 votes vote down vote up
@Bean
  public PasswordEncoder encoder() {
//    return new StandardPasswordEncoder("53cr3t");
    return NoOpPasswordEncoder.getInstance();
  }
 
Example 15
Source File: ActuatorSecurityConfig.java    From spring-in-action-5-samples with Apache License 2.0 4 votes vote down vote up
@Bean
public PasswordEncoder passwordEncoder() {
  return NoOpPasswordEncoder.getInstance();
}
 
Example 16
Source File: SecurityConfig.java    From spring-in-action-5-samples with Apache License 2.0 4 votes vote down vote up
@Bean
  public PasswordEncoder encoder() {
//    return new StandardPasswordEncoder("53cr3t");
    return NoOpPasswordEncoder.getInstance();
  }
 
Example 17
Source File: ActuatorSecurityConfig.java    From spring-in-action-5-samples with Apache License 2.0 4 votes vote down vote up
@Bean
public PasswordEncoder passwordEncoder() {
  return NoOpPasswordEncoder.getInstance();
}
 
Example 18
Source File: SecurityConfig.java    From microservice-integration with MIT License 4 votes vote down vote up
@Bean
public PasswordEncoder passwordEncoder() {
    return NoOpPasswordEncoder.getInstance();
}
 
Example 19
Source File: SecurityConfig.java    From Vaadin4Spring-MVP-Sample-SpringSecurity with Apache License 2.0 4 votes vote down vote up
@Bean
public PasswordEncoder passwordEncoder() {
	return NoOpPasswordEncoder.getInstance();
}
 
Example 20
Source File: SecurityConfig.java    From spring-in-action-5-samples with Apache License 2.0 4 votes vote down vote up
@Bean
  public PasswordEncoder encoder() {
//    return new StandardPasswordEncoder("53cr3t");
    return NoOpPasswordEncoder.getInstance();
  }