Fix authentication.

This commit is contained in:
Paulo Gustavo Veiga 2024-01-15 16:20:00 -08:00
parent 5fe3bb082a
commit b7591ab995
3 changed files with 6 additions and 4 deletions

View File

@ -4,6 +4,8 @@ import com.wisemapping.config.common.CommonConfig;
import com.wisemapping.config.common.HibernateConfig;
import com.wisemapping.config.common.InterceptorsConfig;
import com.wisemapping.config.common.SecurityConfig;
import com.wisemapping.config.mvc.MvcAppConfig;
import com.wisemapping.config.mvc.MvcSecurityConfig;
import com.wisemapping.config.rest.ServletConfig;
import com.wisemapping.config.rest.RestAppConfig;
import org.springframework.boot.WebApplicationType;
@ -19,8 +21,8 @@ public class Application {
new SpringApplicationBuilder()
.parent(HibernateConfig.class, ServletConfig.class, CommonConfig.class, SecurityConfig.class).web(WebApplicationType.NONE)
// .child(MvcAppConfig.class, MvcSecurityConfig.class, SecurityConfig.class).web(WebApplicationType.SERVLET)
.child(RestAppConfig.class, ServletConfig.class, InterceptorsConfig.class).web(WebApplicationType.SERVLET)
.child(MvcAppConfig.class, MvcSecurityConfig.class, SecurityConfig.class, InterceptorsConfig.class).web(WebApplicationType.SERVLET)
.sibling(RestAppConfig.class, ServletConfig.class, InterceptorsConfig.class).web(WebApplicationType.SERVLET)
.run(args);
}

View File

@ -45,7 +45,7 @@ public class SecurityConfig {
@Bean
public PasswordEncoder passwordEncoder() {
return createDelegatingPasswordEncoder();
return DefaultPasswordEncoderFactories.createDelegatingPasswordEncoder();
}
@Bean

View File

@ -28,7 +28,7 @@ public class DefaultPasswordEncoderFactories {
public static final String ENCODING_ID = "bcrypt";
static PasswordEncoder createDelegatingPasswordEncoder() {
public static PasswordEncoder createDelegatingPasswordEncoder() {
final Map<String, PasswordEncoder> encoders = new HashMap<>();
encoders.put(ENCODING_ID, new BCryptPasswordEncoder(12));