1 |
59336
|
k.triantaf
|
package eu.dnetlib.uoaauthorizationlibrary.security;
|
2 |
|
|
|
3 |
|
|
import org.springframework.context.annotation.ComponentScan;
|
4 |
|
|
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
|
5 |
|
|
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
6 |
|
|
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
7 |
|
|
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
8 |
|
|
|
9 |
59340
|
k.triantaf
|
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
|
10 |
59336
|
k.triantaf
|
@EnableWebSecurity
|
11 |
|
|
@ComponentScan(basePackages = {"eu.dnetlib.uoaauthorizationlibrary.*"})
|
12 |
|
|
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
13 |
|
|
|
14 |
|
|
@Override
|
15 |
|
|
protected void configure(HttpSecurity http) throws Exception {
|
16 |
60130
|
k.triantaf
|
http.csrf().disable();
|
17 |
59338
|
k.triantaf
|
http.authorizeRequests().anyRequest().permitAll();
|
18 |
59959
|
k.triantaf
|
http.httpBasic().authenticationEntryPoint(new EntryPoint());
|
19 |
59336
|
k.triantaf
|
}
|
20 |
|
|
|
21 |
|
|
}
|