1
votes

i have 2 problems while using spring boot admin

1) i want to use spring boot admin via ssl(https), but he is loading the assets via http, so i'm getting an error

enter image description here

2) i'm connecting spring boot admin to 8 different servers, on some of them actuator endpoints are under authentication (spring boot security), how to i pass custom user name and password from spring boot admin server to the actuator endpoints?, or any other custom header.

thanks for your help

1

1 Answers

0
votes

About question 2)

If your Spring boot application secured by http basic auth. like this,

@Configuration
@Order(1)
@ConditionalOnProperty(name="spring.boot.admin.client.enabled", havingValue="true", matchIfMissing=false)
public class ActuatorConfig extends WebSecurityConfigurerAdapter {
    @Value("${spring.boot.admin.client.instance.metadata.user.name:actuator}")
    private String actuatorName;
    @Value("${spring.boot.admin.client.instance.metadata.user.password:secret}")
    private String actuatorPassword;

    @Override
    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
        auth.inMemoryAuthentication().withUser(actuatorName).password("{noop}"+actuatorPassword).authorities("ACTUATOR");
    }

    @Override
    public void configure(HttpSecurity http) throws Exception {
        http
            .antMatcher("/actuator/**")
            .authorizeRequests()
                .anyRequest().hasAuthority("ACTUATOR") 
            .and()
                .httpBasic();
    }
}

the user name & password of actuator end point are defined by application.properties or application.yml in spring boot application (not spring boot admin server) like this,

spring.boot.admin.client.instance.metadata.user.name=actuator
spring.boot.admin.client.instance.metadata.user.password=secret

Your spring boot appicaitions will connect to the spring boot admin server with those information and the spring boot admin server will use those information to connect your application's actuator endpoint back.

  • confirmed with Spring boot Admin 2.1.2