Skip to content

Commit

Permalink
Allow all origins
Browse files Browse the repository at this point in the history
  • Loading branch information
federicaagostini committed Mar 11, 2024
1 parent 6adf138 commit 1971da7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
*/
package it.infn.mw.iam.config.security;

import java.util.List;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand Down Expand Up @@ -46,24 +44,13 @@ public class CorsConfig {
};
//@formatter:on

private List<String> allowedOrigins;

public List<String> getAllowedOrigins() {
return allowedOrigins;
}

public void setAllowedOrigins(List<String> allowedOrigins) {
this.allowedOrigins = allowedOrigins;
}

@Bean
CorsFilter corsFilter() {

CorsConfiguration corsConfig = new CorsConfiguration();
corsConfig.setAllowedMethods(
java.util.List.of("HEAD", "GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"));
corsConfig.applyPermitDefaultValues();
corsConfig.setAllowedOriginPatterns(allowedOrigins);

UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
for (String m : CORS_ENDPOINT_MATCHERS) {
Expand Down
3 changes: 0 additions & 3 deletions iam-login-service/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,6 @@ spring:
pathmatch:
matching-strategy: "ant-path-matcher"

cors:
allowed-origins: ${ALLOWED_ORIGINS:**}

iam:
host: ${IAM_HOST:localhost}
baseUrl: ${IAM_BASE_URL:http://${iam.host}:8080}
Expand Down

0 comments on commit 1971da7

Please sign in to comment.