user3044552
user3044552

Reputation: 47

Spring boot health check redirecting to Sign on page on Boot upgrade

Getting health check link redirected to Sign on Page after boot upgrade

Need help to prevent health check link getting redirected to sign on page

enter image description here

Upvotes: 0

Views: 722

Answers (1)

jacky-neo
jacky-neo

Reputation: 853

  1. in application.yml, change mgmt port to another port for security and add a base-path such as '/mgmt' to do easily in second step.
management:
  server:
    port: 12000 # diffrent from server.port
  endpoints:
    web:
      base-path: /mgmt
      exposure:
        include: "*"
  1. config ignore in SecurityConfiguration as below
@Configuration
@EnableWebSecurity
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {

   @Override
    public void configure(WebSecurity web) throws Exception {
       String [] notauthlist = {"/mgmt/**"};
       web.ignoring().antMatchers(notauthlist);
    }
}

Upvotes: 1

Related Questions