<div dir="ltr"><div>I have created <a href="https://issues.jboss.org/browse/KEYCLOAK-3297">KEYCLOAK-3297</a> .</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 11, 2016 at 7:29 PM, Bruno Oliveira <span dir="ltr">&lt;<a href="mailto:bruno@abstractj.org" target="_blank">bruno@abstractj.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Please, go ahead and create one. I couldn&#39;t find any Jira related to this.</div><div class="HOEnZb"><div class="h5"><br><div class="gmail_quote"><div dir="ltr">On Mon, Jul 11, 2016 at 1:36 PM Hubert Przybysz &lt;<a href="mailto:h.p.przybysz@gmail.com" target="_blank">h.p.przybysz@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Does anyone know when it will be possible to configure the adapters with CORS expose headers? <div><br></div><div>I don&#39;t find any jira for it.<div><br></div><div>Br / Hubert.</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 11, 2016 at 6:13 PM, Bruno Oliveira <span dir="ltr">&lt;<a href="mailto:bruno@abstractj.org" target="_blank">bruno@abstractj.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You are right Hubert it&#39;s not supported at keycloak.json file, I just overlooked the code.<br>
Sorry about that.<br>
<div><div><br>
On 2016-07-11, Hubert Przybysz wrote:<br>
&gt; Thanks for the info.<br>
&gt;<br>
&gt; I&#39;ve tried configuring cors-exposed-headers in a JBOSS EAP 6 adapter like<br>
&gt; this:<br>
&gt;<br>
&gt; keycloak.json:<br>
&gt; {<br>
&gt; ...<br>
&gt;<br>
&gt;   &quot;enable-cors&quot; : true,<br>
&gt;<br>
&gt;   &quot;cors-allowed-methods&quot; : &quot;POST,PUT,DELETE,GET&quot;,<br>
&gt;<br>
&gt;   &quot;cors-allowed-headers&quot; :<br>
&gt; &quot;Accept,Content-Type,If-Match,If-None-Match,Origin&quot;,<br>
&gt;<br>
&gt;   &quot;cors-exposed-headers&quot; : &quot;ETag,Location&quot;,<br>
&gt;<br>
&gt; ...<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt;<br>
&gt; But the adapter does not recognise this config and fails to start:<br>
&gt;<br>
&gt; 10:57:15,923 ERROR [org.apache.catalina.core] (ServerService Thread Pool --<br>
&gt; 69) JBWEB001097: Error starting context /data: java.lang.RuntimeException:<br>
&gt; com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException:<br>
&gt; Unrecognized field &quot;cors-exposed-headers&quot; (class<br>
&gt; org.keycloak.representations.adapters.config.AdapterConfig), not marked as<br>
&gt; ignorable (32 known properties: &quot;ssl-required&quot;, &quot;cors-allowed-headers&quot;,<br>
&gt; &quot;register-node-period&quot;, &quot;turn-off-change-session-id-on-login&quot;,<br>
&gt; &quot;truststore&quot;, &quot;always-refresh-token&quot;, &quot;client-key-password&quot;,<br>
&gt; &quot;policy-enforcer&quot;, &quot;token-store&quot;, &quot;resource&quot;, &quot;realm&quot;, &quot;proxy-url&quot;,<br>
&gt; &quot;disable-trust-manager&quot;, &quot;bearer-only&quot;, &quot;truststore-password&quot;,<br>
&gt; &quot;use-resource-role-mappings&quot;, &quot;connection-pool-size&quot;, &quot;client-keystore&quot;,<br>
&gt; &quot;register-node-at-startup&quot;, &quot;client-keystore-password&quot;, &quot;auth-server-url&quot;,<br>
&gt; &quot;cors-allowed-methods&quot;, &quot;public-client&quot;, &quot;expose-token&quot;,<br>
&gt; &quot;token-minimum-time-to-live&quot;, &quot;enable-basic-auth&quot;, &quot;cors-max-age&quot;,<br>
&gt; &quot;enable-cors&quot;, &quot;allow-any-hostname&quot;, &quot;realm-public-key&quot;, &quot;credentials&quot;,<br>
&gt; &quot;principal-attribute&quot;])<br>
&gt;<br>
&gt;  at [Source: java.io.ByteArrayInputStream@67593e31; line: 14, column: 29]<br>
&gt; (through reference chain:<br>
&gt; org.keycloak.representations.adapters.config.AdapterConfig[&quot;cors-exposed-headers&quot;])<br>
&gt;<br>
&gt; at<br>
&gt; org.keycloak.adapters.KeycloakDeploymentBuilder.loadAdapterConfig(KeycloakDeploymentBuilder.java:137)<br>
&gt; [keycloak-adapter-core-2.0.0.Final.jar:2.0.0.Final]<br>
&gt;<br>
&gt; at<br>
&gt; org.keycloak.adapters.KeycloakDeploymentBuilder.build(KeycloakDeploymentBuilder.java:126)<br>
&gt; [keycloak-adapter-core-2.0.0.Final.jar:2.0.0.Final]<br>
&gt;<br>
&gt; at<br>
&gt; org.keycloak.adapters.tomcat.AbstractKeycloakAuthenticatorValve.keycloakInit(AbstractKeycloakAuthenticatorValve.java:133)<br>
&gt; [keycloak-tomcat-core-adapter-2.0.0.Final.jar:2.0.0.Final]<br>
&gt;<br>
&gt; at<br>
&gt; org.keycloak.adapters.tomcat.AbstractKeycloakAuthenticatorValve.lifecycleEvent(AbstractKeycloakAuthenticatorValve.java:75)<br>
&gt; [keycloak-tomcat-core-adapter-2.0.0.Final.jar:2.0.0.Final]<br>
&gt;<br>
&gt; at<br>
&gt; org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:115)<br>
&gt; [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]<br>
&gt;<br>
&gt; at<br>
&gt; org.apache.catalina.core.StandardContext.start(StandardContext.java:3775)<br>
&gt; [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]<br>
&gt;<br>
&gt; at<br>
&gt; org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:163)<br>
&gt; [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]<br>
&gt;<br>
&gt; at<br>
&gt; org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:61)<br>
&gt; [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]<br>
&gt;<br>
&gt; at<br>
&gt; org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96)<br>
&gt; [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]<br>
&gt;<br>
&gt; at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)<br>
&gt; [rt.jar:1.7.0_80]<br>
&gt;<br>
&gt; at java.util.concurrent.FutureTask.run(FutureTask.java:262)<br>
&gt; [rt.jar:1.7.0_80]<br>
&gt;<br>
&gt; at<br>
&gt; java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)<br>
&gt; [rt.jar:1.7.0_80]<br>
&gt;<br>
&gt; at<br>
&gt; java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)<br>
&gt; [rt.jar:1.7.0_80]<br>
&gt;<br>
&gt; at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_80]<br>
&gt;<br>
&gt; at org.jboss.threads.JBossThread.run(JBossThread.java:122)<br>
&gt;<br>
&gt; Caused by:<br>
&gt; com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException:<br>
&gt; Unrecognized field &quot;cors-exposed-headers&quot; (class<br>
&gt; org.keycloak.representations.adapters.config.AdapterConfig), not marked as<br>
&gt; ignorable (32 known properties: &quot;ssl-required&quot;, &quot;cors-allowed-headers&quot;,<br>
&gt; &quot;register-node-period&quot;, &quot;turn-off-change-session-id-on-login&quot;,<br>
&gt; &quot;truststore&quot;, &quot;always-refresh-token&quot;, &quot;client-key-password&quot;,<br>
&gt; &quot;policy-enforcer&quot;, &quot;token-store&quot;, &quot;resource&quot;, &quot;realm&quot;, &quot;proxy-url&quot;,<br>
&gt; &quot;disable-trust-manager&quot;, &quot;bearer-only&quot;, &quot;truststore-password&quot;,<br>
&gt; &quot;use-resource-role-mappings&quot;, &quot;connection-pool-size&quot;, &quot;client-keystore&quot;,<br>
&gt; &quot;register-node-at-startup&quot;, &quot;client-keystore-password&quot;, &quot;auth-server-url&quot;,<br>
&gt; &quot;cors-allowed-methods&quot;, &quot;public-client&quot;, &quot;expose-token&quot;,<br>
&gt; &quot;token-minimum-time-to-live&quot;, &quot;enable-basic-auth&quot;, &quot;cors-max-age&quot;,<br>
&gt; &quot;enable-cors&quot;, &quot;allow-any-hostname&quot;, &quot;realm-public-key&quot;, &quot;credentials&quot;,<br>
&gt; &quot;principal-attribute&quot;])<br>
&gt;<br>
&gt;  at [Source: java.io.ByteArrayInputStream@67593e31; line: 14, column: 29]<br>
&gt; (through reference chain:<br>
&gt; org.keycloak.representations.adapters.config.AdapterConfig[&quot;cors-exposed-headers&quot;])<br>
&gt;<br>
&gt; at<br>
&gt; com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:51)<br>
&gt;<br>
&gt; at<br>
&gt; com.fasterxml.jackson.databind.DeserializationContext.reportUnknownProperty(DeserializationContext.java:817)<br>
&gt;<br>
&gt; at<br>
&gt; com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:958)<br>
&gt;<br>
&gt; at<br>
&gt; com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1324)<br>
&gt;<br>
&gt; at<br>
&gt; com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1302)<br>
&gt;<br>
&gt; at<br>
&gt; com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:249)<br>
&gt;<br>
&gt; at<br>
&gt; com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:136)<br>
&gt;<br>
&gt; at<br>
&gt; com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3564)<br>
&gt;<br>
&gt; at<br>
&gt; com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2650)<br>
&gt;<br>
&gt; at<br>
&gt; org.keycloak.adapters.KeycloakDeploymentBuilder.loadAdapterConfig(KeycloakDeploymentBuilder.java:135)<br>
&gt; [keycloak-adapter-core-2.0.0.Final.jar:2.0.0.Final]<br>
&gt;<br>
&gt; ... 14 more<br>
&gt;<br>
&gt;<br>
&gt; 10:57:15,973 ERROR [org.apache.catalina.core] (ServerService Thread Pool --<br>
&gt; 69) JBWEB001103: Error detected during context /data start, will stop it<br>
&gt;<br>
&gt; 10:57:15,985 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool<br>
&gt; -- 69) MSC000001: Failed to start service<br>
&gt; jboss.web.deployment.default-host./data:<br>
&gt; org.jboss.msc.service.StartException in service<br>
&gt; jboss.web.deployment.default-host./data:<br>
&gt; org.jboss.msc.service.StartException in anonymous service: JBAS018040:<br>
&gt; Failed to start context<br>
&gt;<br>
&gt; at<br>
&gt; org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:99)<br>
&gt;<br>
&gt; at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)<br>
&gt; [rt.jar:1.7.0_80]<br>
&gt;<br>
&gt; at java.util.concurrent.FutureTask.run(FutureTask.java:262)<br>
&gt; [rt.jar:1.7.0_80]<br>
&gt;<br>
&gt; at<br>
&gt; java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)<br>
&gt; [rt.jar:1.7.0_80]<br>
&gt;<br>
&gt; at<br>
&gt; java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)<br>
&gt; [rt.jar:1.7.0_80]<br>
&gt;<br>
&gt; at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_80]<br>
&gt;<br>
&gt; at org.jboss.threads.JBossThread.run(JBossThread.java:122)<br>
&gt;<br>
&gt; Caused by: org.jboss.msc.service.StartException in anonymous service:<br>
&gt; JBAS018040: Failed to start context<br>
&gt;<br>
&gt; at<br>
&gt; org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:168)<br>
&gt;<br>
&gt; at<br>
&gt; org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:61)<br>
&gt;<br>
&gt; at<br>
&gt; org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96)<br>
&gt;<br>
&gt; ... 6 more<br>
&gt;<br>
&gt;<br>
&gt; 10:57:16,019 ERROR [org.jboss.as.controller.management-operation]<br>
&gt; (Controller Boot Thread) JBAS014612: Operation (&quot;deploy&quot;) failed - address:<br>
&gt; ([(&quot;deployment&quot; =&gt; &quot;webims-jcom-data-1.3.1-SNAPSHOT-secure-keycloak.war&quot;)])<br>
&gt; - failure description: {&quot;JBAS014671: Failed services&quot; =&gt;<br>
&gt; {&quot;jboss.web.deployment.default-host./data&quot; =&gt;<br>
&gt; &quot;org.jboss.msc.service.StartException in service<br>
&gt; jboss.web.deployment.default-host./data:<br>
&gt; org.jboss.msc.service.StartException in anonymous service: JBAS018040:<br>
&gt; Failed to start context<br>
&gt;<br>
&gt;     Caused by: org.jboss.msc.service.StartException in anonymous service:<br>
&gt; JBAS018040: Failed to start context&quot;}}<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Sat, Jul 9, 2016 at 7:38 AM, Bruno Oliveira &lt;<a href="mailto:bruno@abstractj.org" target="_blank">bruno@abstractj.org</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt; As far as I can tell, yes.<br>
&gt; &gt;<br>
&gt; &gt; See:<br>
&gt; &gt;<br>
&gt; &gt; <a href="https://keycloak.gitbooks.io/server-adminstration-guide/content/topics/clients/client-oidc.html" rel="noreferrer" target="_blank">https://keycloak.gitbooks.io/server-adminstration-guide/content/topics/clients/client-oidc.html</a><br>
&gt; &gt;<br>
&gt; &gt; <a href="https://github.com/keycloak/keycloak/blob/5c98b8c6ae7052b2d906156d8fc212ccd9dfd57d/services/src/main/java/org/keycloak/services/resources/Cors.java#L143" rel="noreferrer" target="_blank">https://github.com/keycloak/keycloak/blob/5c98b8c6ae7052b2d906156d8fc212ccd9dfd57d/services/src/main/java/org/keycloak/services/resources/Cors.java#L143</a><br>
&gt; &gt;<br>
&gt; &gt; On 2016-07-08, Hubert Przybysz wrote:<br>
&gt; &gt; &gt; Hi,<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Is configuration of CORS Access-Control-Expose-Headers supported in<br>
&gt; &gt; &gt; 2.0.0.Final adapters?<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Best regards / Hubert.<br>
&gt; &gt;<br>
&gt; &gt; &gt; _______________________________________________<br>
&gt; &gt; &gt; keycloak-user mailing list<br>
&gt; &gt; &gt; <a href="mailto:keycloak-user@lists.jboss.org" target="_blank">keycloak-user@lists.jboss.org</a><br>
&gt; &gt; &gt; <a href="https://lists.jboss.org/mailman/listinfo/keycloak-user" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a><br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; --<br>
&gt; &gt;<br>
&gt; &gt; abstractj<br>
&gt; &gt; PGP: 0x84DC9914<br>
&gt; &gt;<br>
<br>
</div></div>--<br>
<br>
abstractj<br>
PGP: 0x84DC9914<br>
</blockquote></div><br></div>
</blockquote></div>
</div></div></blockquote></div><br></div>