This is the spring security condfig
http
.cors()
.and()
.csrf().disable()
.authorizeRequests()
.antMatchers(ignores).permitAll()
.anyRequest().authenticated()
.and().exceptionHandling().authenticationEntryPoint(unauthorizedHandler)
.and().sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and().csrf().csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse())
.ignoringAntMatchers("/instances","/actuator/**");
the cors is configured to allowed all region.
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("*")
.allowedMethods("POST", "GET", "PUT", "OPTIONS", "DELETE")
.maxAge(3600)
.allowCredentials(true);
}
If the add following code, we got 401 on spring boot admin. Where/what config do I need?
@Bean
public PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}