Merge pull request #323 from stianst/master

Move setting cors properties
This commit is contained in:
Stian Thorgersen 2014-04-07 13:59:39 +01:00
commit aec8feab49

View file

@ -51,6 +51,13 @@ public class KeycloakDeploymentBuilder {
deployment.setPublicClient(adapterConfig.isPublicClient());
deployment.setUseResourceRoleMappings(adapterConfig.isUseResourceRoleMappings());
if (adapterConfig.isCors()) {
deployment.setCors(true);
deployment.setCorsMaxAge(adapterConfig.getCorsMaxAge());
deployment.setCorsAllowedHeaders(adapterConfig.getCorsAllowedHeaders());
deployment.setCorsAllowedMethods(adapterConfig.getCorsAllowedMethods());
}
if (adapterConfig.isBearerOnly()) {
deployment.setBearerOnly(true);
return deployment;
@ -73,13 +80,6 @@ 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;
}