Move setting cors properties

This commit is contained in:
Stian Thorgersen 2014-04-07 13:58:35 +01:00
parent bf95c2ba85
commit e7c30fff48

View file

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