X-Git-Url: https://gerrit.onap.org/r/gitweb?p=portal.git;a=blobdiff_plain;f=portal-BE%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fportal%2Fconfiguration%2FSecurityConfig.java;h=a0542ec495b341efcb3aeaf52e10bc6c9150dc02;hp=3fae09cf33c2a82ca616d0db5eddb57248b2ced4;hb=ffd9af970318c1f5a0bad46d7aad5d4611414aae;hpb=39fb119cdaea6bd8d801b22d195db39f6d8faaca diff --git a/portal-BE/src/main/java/org/onap/portal/configuration/SecurityConfig.java b/portal-BE/src/main/java/org/onap/portal/configuration/SecurityConfig.java index 3fae09cf..a0542ec4 100644 --- a/portal-BE/src/main/java/org/onap/portal/configuration/SecurityConfig.java +++ b/portal-BE/src/main/java/org/onap/portal/configuration/SecurityConfig.java @@ -52,45 +52,47 @@ import org.springframework.security.crypto.password.PasswordEncoder; @Configuration @EnableWebSecurity public class SecurityConfig extends WebSecurityConfigurerAdapter { - @Autowired - private FnUserService fnUserService; - @Override - protected void configure(AuthenticationManagerBuilder auth) throws Exception { - auth.userDetailsService(fnUserService) - .passwordEncoder(new PasswordEncoder() { - @Override - public String encode(CharSequence rawPassword) { - return rawPassword.toString(); - } + @Autowired + private FnUserService fnUserService; - @Override - public boolean matches(CharSequence rawPassword, String encodedPassword) { - return true; - } - }); - } + @Override + protected void configure(AuthenticationManagerBuilder auth) throws Exception { + auth.userDetailsService(fnUserService) + .passwordEncoder(new PasswordEncoder() { + @Override + public String encode(CharSequence rawPassword) { + return rawPassword.toString(); + } - @Override - protected void configure(HttpSecurity http) throws Exception { - http - .authorizeRequests() - .antMatchers("/img/**").permitAll() - .anyRequest().authenticated() - .and() - .formLogin() - .loginPage("/login") - .permitAll() - .and() - .logout() - .permitAll() - .and() - .httpBasic(); + @Override + public boolean matches(CharSequence rawPassword, String encodedPassword) { + return true; + } + }); + } - http.csrf().disable(); - http.headers().frameOptions().disable(); + @Override + protected void configure(HttpSecurity http) throws Exception { + http + .authorizeRequests() + .antMatchers("/img/**").permitAll() + .antMatchers("/h2-console/**").permitAll() + .anyRequest().authenticated() + .and() + .formLogin() + .loginPage("/login") + .permitAll() + .and() + .logout() + .permitAll() + .and() + .httpBasic(); - } + http.csrf().disable(); + http.headers().frameOptions().disable(); + + } }