Project

General

Profile

1
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
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
10
@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
        http.csrf().disable();
17
        http.authorizeRequests().anyRequest().permitAll();
18
        http.httpBasic().authenticationEntryPoint(new EntryPoint());
19
    }
20

    
21
}
(5-5/5)