Giriş
Bu sınıfın tam adı aslında HttpSecurity.RequestMatcherConfigurer. Açıklaması şöyle. Eğer bu sınıfı kullanmazsak root "/" yolundan itibaren security uygulanır.
Bu sınıfın tam adı aslında HttpSecurity.RequestMatcherConfigurer. Açıklaması şöyle. Eğer bu sınıfı kullanmazsak root "/" yolundan itibaren security uygulanır.
The purpose of requestMatchers() is to specify which requests the spring security configuration will be applied to.antMatchers metodu
Şöyle yaparız
http.requestMatchers()
  .antMatchers("/management/**")         // (1)
  .and()
    .authorizeRequests()                 // (2)
      .antMatchers("/management/health")
        .permitAll()
      .antMatchers("/management/info")
       .permitAll()
     .antMatchers("/management/**")
        .hasRole("ACTUATOR")
        .anyRequest().permitAll()
    .and()
      .httpBasic();                      //(3) 
Hiç yorum yok:
Yorum Gönder