diff options
Diffstat (limited to 'ecomp-portal-widget-ms/src/main/java/org/openecomp/portalapp/widget/filters/CorsConfiguration.java')
-rw-r--r-- | ecomp-portal-widget-ms/src/main/java/org/openecomp/portalapp/widget/filters/CorsConfiguration.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ecomp-portal-widget-ms/src/main/java/org/openecomp/portalapp/widget/filters/CorsConfiguration.java b/ecomp-portal-widget-ms/src/main/java/org/openecomp/portalapp/widget/filters/CorsConfiguration.java new file mode 100644 index 00000000..2fdb5480 --- /dev/null +++ b/ecomp-portal-widget-ms/src/main/java/org/openecomp/portalapp/widget/filters/CorsConfiguration.java @@ -0,0 +1,15 @@ +package org.openecomp.portalapp.widget.filters; + +import org.springframework.context.annotation.Configuration; +import org.springframework.http.HttpMethod; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; + +@Configuration +public class CorsConfiguration extends WebSecurityConfigurerAdapter { + @Override + protected void configure(HttpSecurity http) throws Exception { + http.authorizeRequests().antMatchers(HttpMethod.OPTIONS, "/microservices/widgetCatalog/").permitAll(); + http.csrf().disable(); + } +} |