Skip to content

Commit

Permalink
EPMRPP-87165 || Add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
APiankouski committed Aug 14, 2024
1 parent 8d0f4cf commit 645f375
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ protected AuthenticationProvider getDelegate() {
* New encoder cannot be used everywhere since it does not have implementation for LDAP
*/
LOGGER.error("PASSWORD_ENCODER_TYPE: " + it);
final PasswordEncoder delegate = CustomPasswordEncoderFactory.createDelegatingPasswordEncoder().get(it.toLowerCase());
final PasswordEncoder delegate = CustomPasswordEncoderFactory.createDelegatingPasswordEncoder();

builder.passwordEncoder(new org.springframework.security.crypto.password.PasswordEncoder() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@
*/
public class CustomPasswordEncoderFactory {

public static Map<String, PasswordEncoder> createDelegatingPasswordEncoder() {
public static PasswordEncoder createDelegatingPasswordEncoder() {
String encodingId = "bcrypt";
Map<String, PasswordEncoder> encoders = new HashMap<>();
encoders.put("bcrypt", new BCryptPasswordEncoder());
encoders.put(encodingId, new BCryptPasswordEncoder());
encoders.put("ldap", new org.springframework.security.crypto.password.LdapShaPasswordEncoder());

Check failure

Code scanning / SonarCloud

Passwords should not be stored in plaintext or with a fast hashing algorithm High

Use secure "PasswordEncoder" implementation. See more on SonarCloud
encoders.put("MD4", new org.springframework.security.crypto.password.Md4PasswordEncoder());

Check failure

Code scanning / SonarCloud

Passwords should not be stored in plaintext or with a fast hashing algorithm High

Use secure "PasswordEncoder" implementation. See more on SonarCloud
encoders.put("MD5", new org.springframework.security.crypto.password.MessageDigestPasswordEncoder("MD5"));

Check failure

Code scanning / SonarCloud

Passwords should not be stored in plaintext or with a fast hashing algorithm High

Use secure "PasswordEncoder" implementation. See more on SonarCloud
Expand All @@ -50,7 +51,7 @@ public static Map<String, PasswordEncoder> createDelegatingPasswordEncoder() {
new org.springframework.security.crypto.password.MessageDigestPasswordEncoder("SHA-256"));

Check failure

Code scanning / SonarCloud

Passwords should not be stored in plaintext or with a fast hashing algorithm High

Use secure "PasswordEncoder" implementation. See more on SonarCloud
encoders.put("sha256", new org.springframework.security.crypto.password.StandardPasswordEncoder());

Check failure

Code scanning / SonarCloud

Passwords should not be stored in plaintext or with a fast hashing algorithm High

Use secure "PasswordEncoder" implementation. See more on SonarCloud
encoders.put("argon2", new Argon2PasswordEncoder());
return encoders;
return new DelegatingPasswordEncoder(encodingId, encoders);
}

}

0 comments on commit 645f375

Please sign in to comment.