From 2110c52f8c84cd9330da668a43e00e34f645f867 Mon Sep 17 00:00:00 2001 From: Piotr Borelowski Date: Wed, 5 Feb 2020 19:01:45 +0100 Subject: Changed Basic Authorization in receiving Notification Ve-Vnfm (SOL002) Adapter project Issue-ID: SO-2574 Signed-off-by: Piotr Borelowski Change-Id: I95dfebd0e024af91b9bac4d8a4bb97d271badc70 --- .../so/security/SoBasicWebSecurityConfigurerAdapter.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'common') diff --git a/common/src/main/java/org/onap/so/security/SoBasicWebSecurityConfigurerAdapter.java b/common/src/main/java/org/onap/so/security/SoBasicWebSecurityConfigurerAdapter.java index c778dde9af..21176e0d5d 100644 --- a/common/src/main/java/org/onap/so/security/SoBasicWebSecurityConfigurerAdapter.java +++ b/common/src/main/java/org/onap/so/security/SoBasicWebSecurityConfigurerAdapter.java @@ -28,6 +28,8 @@ import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.builders.WebSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.web.firewall.StrictHttpFirewall; import org.springframework.util.StringUtils; @@ -44,6 +46,12 @@ public class SoBasicWebSecurityConfigurerAdapter extends WebSecurityConfigurerAd @Autowired private SoUserCredentialConfiguration soUserCredentialConfiguration; + @Autowired + private UserDetailsService userDetailsService; + + @Autowired + private BCryptPasswordEncoder passwordEncoder; + @Override protected void configure(final HttpSecurity http) throws Exception { http.csrf().disable().authorizeRequests().antMatchers("/manage/health", "/manage/info").permitAll() @@ -61,8 +69,6 @@ public class SoBasicWebSecurityConfigurerAdapter extends WebSecurityConfigurerAd @Override protected void configure(final AuthenticationManagerBuilder auth) throws Exception { - auth.userDetailsService(soUserCredentialConfiguration.userDetailsService()) - .passwordEncoder(soUserCredentialConfiguration.passwordEncoder()); + auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder); } - } -- cgit 1.2.3-korg