Merge pull request #323 from stianst/master
Move setting cors properties
This commit is contained in:
commit
aec8feab49
1 changed files with 7 additions and 7 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue