From bf95c2ba850eb159116e765b1c3c795045b20561 Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Mon, 7 Apr 2014 13:39:32 +0100 Subject: [PATCH] KEYCLOAK-411 Set cors properties in KeycloakDeployment --- .../org/keycloak/adapters/KeycloakDeploymentBuilder.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/integration/adapter-core/src/main/java/org/keycloak/adapters/KeycloakDeploymentBuilder.java b/integration/adapter-core/src/main/java/org/keycloak/adapters/KeycloakDeploymentBuilder.java index 297111abb4..39cf52fbe9 100755 --- a/integration/adapter-core/src/main/java/org/keycloak/adapters/KeycloakDeploymentBuilder.java +++ b/integration/adapter-core/src/main/java/org/keycloak/adapters/KeycloakDeploymentBuilder.java @@ -73,6 +73,13 @@ public class KeycloakDeploymentBuilder { deployment.setLogoutUrl(KeycloakUriBuilder.fromUri(logoutUrl)); deployment.setAccountUrl(accountUrl); + if (adapterConfig.isCors()) { + deployment.setCors(true); + deployment.setCorsMaxAge(adapterConfig.getCorsMaxAge()); + deployment.setCorsAllowedHeaders(adapterConfig.getCorsAllowedHeaders()); + deployment.setCorsAllowedMethods(adapterConfig.getCorsAllowedMethods()); + } + return deployment; }