From 9fb7a98d32fd958ef4c483371dc36da0eb97127c Mon Sep 17 00:00:00 2001 From: Pekka Helenius Date: Wed, 7 Oct 2020 11:09:55 +0300 Subject: [PATCH] Replace PasswordEncoderFactories with BCryptPasswordEncoder Signed-off-by: Pekka Helenius --- .../main/java/com/fjordtek/bookstore/BookstoreApplication.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bookstore/src/main/java/com/fjordtek/bookstore/BookstoreApplication.java b/bookstore/src/main/java/com/fjordtek/bookstore/BookstoreApplication.java index c7ff5a6..9314bff 100644 --- a/bookstore/src/main/java/com/fjordtek/bookstore/BookstoreApplication.java +++ b/bookstore/src/main/java/com/fjordtek/bookstore/BookstoreApplication.java @@ -14,6 +14,7 @@ import org.springframework.boot.web.servlet.support.SpringBootServletInitializer import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Profile; import org.springframework.core.env.Environment; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.factory.PasswordEncoderFactories; import org.springframework.security.crypto.password.PasswordEncoder; import org.thymeleaf.templateresolver.UrlTemplateResolver; @@ -78,7 +79,7 @@ public class BookstoreApplication extends SpringBootServletInitializer { return (args) -> { - PasswordEncoder passwordEncoder = PasswordEncoderFactories.createDelegatingPasswordEncoder(); + PasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); commonLogger.info("Add new roles to the database"); Role adminAR = new Role(env.getProperty("auth.authority.admin"));