opening /stats to all

This commit is contained in:
Antonis Lempesis 2020-05-15 08:09:38 +00:00
parent 984dd28d19
commit ae95e76fbf
1 changed files with 6 additions and 1 deletions

View File

@ -12,6 +12,7 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint;
@ -57,12 +58,16 @@ public class AaiSecurityConfiguration extends WebSecurityConfigurerAdapter {
auth.authenticationProvider(openIdConnectAuthenticationProvider());
}
@Override
public void configure(WebSecurity web) throws Exception {
web.ignoring().antMatchers("/stats/**");
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable()
.anonymous().disable()
.authorizeRequests()
.antMatchers("/stats").permitAll()
.anyRequest().authenticated()
.and()
.httpBasic()