2020-09-03 21:40:48 +02:00
|
|
|
package eu.dnetlib.uoaauthorizationlibrary.configuration;
|
|
|
|
|
|
|
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
|
|
|
import org.springframework.context.annotation.*;
|
2023-12-14 14:28:10 +01:00
|
|
|
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
|
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
2020-09-03 21:40:48 +02:00
|
|
|
|
|
|
|
@Configuration
|
2021-09-16 00:10:42 +02:00
|
|
|
@EnableConfigurationProperties({SecurityConfig.class, GlobalVars.class})
|
2020-09-03 21:40:48 +02:00
|
|
|
@ComponentScan(basePackages = { "eu.dnetlib.uoaauthorizationlibrary" })
|
2023-12-14 14:28:10 +01:00
|
|
|
public class AuthorizationConfiguration {
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
public WebMvcConfigurer corsConfigurer() {
|
|
|
|
return new WebMvcConfigurerAdapter() {
|
|
|
|
@Override
|
|
|
|
public void addCorsMappings(CorsRegistry registry) {
|
|
|
|
registry.addMapping("/**")
|
|
|
|
.allowedMethods("GET", "POST", "PUT", "DELETE", "HEAD", "OPTIONS")
|
|
|
|
.allowCredentials(true);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|