-1

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();
    }
shuan
  • 136
  • 1
  • 13

1 Answers1

0

fixed! just add the spring boot admin configured user to the service DB. But I still confuse with that, I all ready configured the spring security to ignore the following path

ignoringAntMatchers("/instances","/actuator/**");
shuan
  • 136
  • 1
  • 13