1

I have a Spring Boot service which is configured using Oath security like this:

@Configuration
@EnableResourceServer
public class SecurityConfig extends ResourceServerConfigurerAdapter {
  @Override
  public void configure(HttpSecurity http) throws Exception {
    http.authorizeRequests()
        .antMatchers("/actuator/**").permitAll()
        .anyRequest().authenticated()
  }
}

The actuator endpoint was excluded from authentification, but now I need to secure it, but not with Oath as the other endpoints, but with Basic Auth with user/password. How can I achieve this? I'm using Spring-Boot version 2.0.2.RELEASE.

Izbassar Tolegen
  • 1,990
  • 2
  • 20
  • 37
  • Not sure whether this helps: https://stackoverflow.com/questions/54716532/spring-boot-2-1-x-how-to-secure-actuator-end-points-with-basic-auth – user14236233 Sep 08 '20 at 14:42
  • In the nutshell it's doesn't matter how to define Principle by Oath or Basic Auth. Please check this video https://www.youtube.com/watch?v=caCJAJC41Rk&list=PLqq-6Pq4lTTYTEooakHchTGglSvkZAjnE&index=6 – dos4dev Sep 08 '20 at 20:02

0 Answers0