2021-12-07 10:23:36 +01:00
|
|
|
package eu.dnetlib.uoaauthorizationlibrary.redis.security;
|
2020-09-03 21:40:48 +02:00
|
|
|
|
2021-12-07 10:23:36 +01:00
|
|
|
import eu.dnetlib.uoaauthorizationlibrary.security.EntryPoint;
|
2020-09-03 21:40:48 +02:00
|
|
|
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
|
|
|
|
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
|
|
|
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
|
|
|
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
|
|
|
|
2020-09-04 13:33:39 +02:00
|
|
|
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
|
2020-09-03 21:40:48 +02:00
|
|
|
@EnableWebSecurity
|
|
|
|
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void configure(HttpSecurity http) throws Exception {
|
2021-12-07 10:23:36 +01:00
|
|
|
http.csrf().disable();
|
2020-09-03 21:49:57 +02:00
|
|
|
http.authorizeRequests().anyRequest().permitAll();
|
2020-11-25 13:30:41 +01:00
|
|
|
http.httpBasic().authenticationEntryPoint(new EntryPoint());
|
2020-09-03 21:40:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|