<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: alfresco + keycloak sync in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/alfresco-keycloak-sync/m-p/143772#M38186</link>
    <description>&lt;P&gt;Now we have another problem: we are using only ACS repository (no share). UI are developed using ADF.&lt;/P&gt;&lt;P&gt;With identity service API calls work.&lt;/P&gt;&lt;P&gt;With alfresco-keycloak, they return 500 with generic Alfresco error page.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is our configuration&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;keycloak.authentication.enabled=true
keycloak.authentication.sso.enabled=true	
keycloak.authentication.sso.handlePublicApi=true

keycloak.adapter.auth-server-url=https://xxxxx/auth
keycloak.adapter.realm=yyyyyyy
keycloak.adapter.resource=zzzzz
keycloak.adapter.credentials.provider=secret
keycloak.adapter.credentials.secret=wwwwwwwww
keycloak.adapter.autodetect-bearer-only=true
keycloak.adapter.enable-basic-auth=true
keycloak.adapter.ssl-required=external	&lt;/PRE&gt;</description>
    <pubDate>Tue, 06 Jul 2021 08:29:34 GMT</pubDate>
    <dc:creator>ilseva</dc:creator>
    <dc:date>2021-07-06T08:29:34Z</dc:date>
    <item>
      <title>alfresco + keycloak sync</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/alfresco-keycloak-sync/m-p/143770#M38184</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;we are developing an extension of alfresco content service using the maven&amp;nbsp;archetype.&lt;/P&gt;&lt;P&gt;Now, we would like to use keycloak for&amp;nbsp;&lt;SPAN&gt;identity and access management.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;We follow this guide&amp;nbsp;&lt;A href="https://docs.google.com/document/d/e/2PACX-1vR0gPSSBzfA4-J-ncau6gHolRKk7sBXkiiTufJQ5cQRJED05fea9l5FpkYrEFKJm_MjF7fwrQ-u6AFg/pub#h.mztdizjsvwg1" target="_blank" rel="noopener nofollow noreferrer"&gt;Deploying Alfresco DBP with Identity Service using Docker Compose&lt;/A&gt;&amp;nbsp;.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Everything work fine for authentication. Issues come when we try to use users and groups from keycloak.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;We learned that, at the moment, the only way to sync users (and groups) between keycloak and alfresco is by SAML Module, that is available only for enterprise customer and we are using the community edition.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;We found another module &lt;A href="https://github.com/Acosix/alfresco-keycloak" target="_blank" rel="noopener nofollow noreferrer"&gt;alfresco-keycloak&lt;/A&gt;, but&amp;nbsp;we were unable to integrate it.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I think that the mantainer of this module is&amp;nbsp;&lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/16045"&gt;@afaust&lt;/A&gt;&amp;nbsp;.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;To integrate alfresco-keycloak we define these dependencies in our alfresco acs pom&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&amp;lt;dependency&amp;gt;
  &amp;lt;groupId&amp;gt;de.acosix.alfresco.utility&amp;lt;/groupId&amp;gt;
  &amp;lt;artifactId&amp;gt;de.acosix.alfresco.utility.repo&amp;lt;/artifactId&amp;gt;
  &amp;lt;version&amp;gt;1.3.0-SNAPSHOT&amp;lt;/version&amp;gt;
  &amp;lt;classifier&amp;gt;installable&amp;lt;/classifier&amp;gt;
&amp;lt;/dependency&amp;gt;&lt;BR /&gt;&amp;lt;dependency&amp;gt;&lt;BR /&gt;   &amp;lt;groupId&amp;gt;de.acosix.alfresco.keycloak&amp;lt;/groupId&amp;gt;&lt;BR /&gt;   &amp;lt;artifactId&amp;gt;de.acosix.alfresco.keycloak.repo&amp;lt;/artifactId&amp;gt;&lt;BR /&gt;   &amp;lt;version&amp;gt;1.1.0-rc7-SNAPSHOT&amp;lt;/version&amp;gt;&lt;BR /&gt;   &amp;lt;classifier&amp;gt;installable&amp;lt;/classifier&amp;gt;&lt;BR /&gt;&amp;lt;/dependency&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;The 1.3.0-SNAPSHOT and&amp;nbsp;1.1.0-rc7-SNAPSHOT is the latest deployed on&amp;nbsp;&lt;A href="https://oss.sonatype.org/content/repositories/snapshots" target="_blank" rel="nofollow noopener noreferrer"&gt;https://oss.sonatype.org/content/repositories/snapshots&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Cutted stacktrace&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;Error creating bean with name 'keycloakDeployment'
Caused by: java.lang.IllegalArgumentException: You did not supply enough values to fill path parameters
edi-acs_1       | 	at de.acosix.alfresco.keycloak.deps.keycloak.common.util.KeycloakUriBuilder.buildFromValues(KeycloakUriBuilder.java:577)&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Configuration&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;authentication.chain=keycloak1:keycloak,alfrescoNtlm1:alfrescoNtlm
keycloak.adapter.auth-server-url=${KEYCLOAK_URL}
keycloak.adapter.credentials.provider=secret
keycloak.adapter.realm=${KEYCLOAK_REALM}
keycloak.adapter.resource=${KEYCLOAK_CLIENT}
keycloak.adapter.credentials.secret=xxxxxxxx&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;${KEYCLOAK_URL}&amp;nbsp;${KEYCLOAK_REALM} ${KEYCLOAK_CLIENT} are set&amp;nbsp;through -D options&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Maybe he could help us...&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jul 2021 15:30:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/alfresco-keycloak-sync/m-p/143770#M38184</guid>
      <dc:creator>ilseva</dc:creator>
      <dc:date>2021-07-05T15:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: alfresco + keycloak sync</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/alfresco-keycloak-sync/m-p/143771#M38185</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I reply myself. Using values instead placeholders in properties file, alfresco-keycloak starts successfully and users and groups were sinchronyzed.&lt;/P&gt;&lt;P&gt;I try to investigate why placeholders are not replaced. If I use identity service module everythings work.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;-S.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jul 2021 07:06:22 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/alfresco-keycloak-sync/m-p/143771#M38185</guid>
      <dc:creator>ilseva</dc:creator>
      <dc:date>2021-07-06T07:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: alfresco + keycloak sync</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/alfresco-keycloak-sync/m-p/143772#M38186</link>
      <description>&lt;P&gt;Now we have another problem: we are using only ACS repository (no share). UI are developed using ADF.&lt;/P&gt;&lt;P&gt;With identity service API calls work.&lt;/P&gt;&lt;P&gt;With alfresco-keycloak, they return 500 with generic Alfresco error page.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is our configuration&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;keycloak.authentication.enabled=true
keycloak.authentication.sso.enabled=true	
keycloak.authentication.sso.handlePublicApi=true

keycloak.adapter.auth-server-url=https://xxxxx/auth
keycloak.adapter.realm=yyyyyyy
keycloak.adapter.resource=zzzzz
keycloak.adapter.credentials.provider=secret
keycloak.adapter.credentials.secret=wwwwwwwww
keycloak.adapter.autodetect-bearer-only=true
keycloak.adapter.enable-basic-auth=true
keycloak.adapter.ssl-required=external	&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Jul 2021 08:29:34 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/alfresco-keycloak-sync/m-p/143772#M38186</guid>
      <dc:creator>ilseva</dc:creator>
      <dc:date>2021-07-06T08:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: alfresco + keycloak sync</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/alfresco-keycloak-sync/m-p/143773#M38187</link>
      <description>&lt;P&gt;Thanks for mentioning me in your post, otherwise I might have missed it. In general, if you want the maintainer of a module to look into one of your issues, it is a good idea to raise such questions / issues in the issue tracker of the addon project - if the project has an issue tracker. Since the alfresco-keycloak addon is on GitHub, it has an issue tracker by default.&lt;/P&gt;
&lt;P&gt;Your placeholders are not resolved because of a general limitation in how Alfresco resolves -D flags to configuration properties. In general, only configuration properties which have been pre-defined in a pre-packaged configuration file (repository.properties, module alfresco-global.properties, or subsystem instance type *.properties) can be resolved. That means in one of those files you would have to have an entry in the form of&lt;/P&gt;
&lt;PRE&gt;KEYCLOAK_REALM=&lt;/PRE&gt;
&lt;P&gt;for a -DKEYCLOAK_REALM=xyz property to be effective, and be referenceable via a ${KEYCLOAK_REALM} placeholder in other properties. The reason for this is that Alfresco only uses an &lt;A href="https://github.com/Alfresco/alfresco-community-repo/blob/46f6d5829eae388bb0aa7dc8b0ef90568a3e0738/repository/src/main/resources/alfresco/core-services-context.xml#L48" target="_self" rel="nofollow noopener noreferrer"&gt;override mode of handling -D flags&lt;/A&gt; instead of fully merging them.&lt;/P&gt;
&lt;P&gt;For the ADF part, I must admit I do not test this as I do not use ADF / ACA / ADW at all in any projects (those are generally useless / too much effort to deal with to achieve even basic non-trivial solutions - compared to Share), so I can't immediately give you an educated guess of what might be failing - I also don't know anythign about your ADF / Keycloak realm config for handling OAuth. What I could imagine is that you are trying to use a Keycloak access token obtained for the ADF application (as a public client) to directly call ACS, which potentially fails in some validation step, assuming ACS is set up as its own Keycloak client. "Unfortunately", the alfresco-keycloak addon is set up to be more compliant / consistent / secure when interacting with Keycloak, while the Identity Service integration really uses a naiive fire/once-and-forget type of integration.&lt;BR /&gt;For alfresco-keycloak, it would normally be expected that a client calling ACS &lt;A href="https://tools.ietf.org/html/rfc8693" target="_self" rel="nofollow noopener noreferrer"&gt;exchange their access token for an access token to the backend resource&lt;/A&gt;. As far as I can remember, ADF requires a public-client type of Keycloak client, which means it will be unable to do such an exchange. You may want to try&lt;/P&gt;
&lt;PRE&gt;keycloak.adapter.verify-token-audience=false&lt;/PRE&gt;
&lt;P&gt;to disable one of the validations, and allow an access token from a public client to be used for direct authentication without exchanging it.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jul 2021 09:10:57 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/alfresco-keycloak-sync/m-p/143773#M38187</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2021-07-06T09:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: alfresco + keycloak sync</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/alfresco-keycloak-sync/m-p/143774#M38188</link>
      <description>&lt;P&gt;Thanks for you reply&amp;nbsp;&lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/16045"&gt;@afaust&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;I know that github has its own issue tracker, but I posted in alfresco forum because I think it could be usefull for other people that want to integrate your module with their own alfresco extension.&lt;/P&gt;&lt;P&gt;By the way, I will open an issue on github about the release of no SNAPSHOT version compliant to 7.0 &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Regarding the issue with ADF, I understand what you say about the flow of the token. I will try to set&amp;nbsp;&lt;EM&gt;verify-token-audience&lt;/EM&gt; to false.&lt;/P&gt;&lt;P&gt;At the moment, I try to use both identity-service and keycloak-alfresco in my configuration&lt;/P&gt;&lt;PRE&gt;authentication.chain=identity-service1:identity-service,keycloak1:keycloak,alfrescoNtlm1:alfrescoNtlm

keycloak.authentication.enabled=false
keycloak.authentication.sso.enabled=false	
keycloak.adapter.auth-server-url=https://xxxxx
keycloak.adapter.realm=yyyyy
keycloak.adapter.resource=zzzz
keycloak.adapter.credentials.provider=secret
keycloak.adapter.credentials.secret=1wwwww
keycloak.adapter.ssl-required=external	

identity-service.authentication.enabled=true
identity-service.enable-basic-auth=false
identity-service.authentication.validation.failure.silent=false
identity-service.auth-server-url=${KEYCLOAK_URL}
identity-service.realm=${KEYCLOAK_REALM}
identity-service.resource=${KEYCLOAK_CLIENT}&lt;/PRE&gt;&lt;P&gt;it seems to work.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jul 2021 13:42:01 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/alfresco-keycloak-sync/m-p/143774#M38188</guid>
      <dc:creator>ilseva</dc:creator>
      <dc:date>2021-07-06T13:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: alfresco + keycloak sync</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/alfresco-keycloak-sync/m-p/143775#M38189</link>
      <description>&lt;P&gt;We try to set parameter as&amp;nbsp;&lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/16045"&gt;@afaust&lt;/A&gt;&amp;nbsp;suggests to us and for basic operations works.&lt;/P&gt;&lt;P&gt;So, our new configuration is&lt;/P&gt;&lt;PRE&gt;authentication.chain=keycloak1:keycloak,alfrescoNtlm1:alfrescoNtlm

keycloak.authentication.sso.handlePublicApi=true
keycloak.authentication.enabled=true
keycloak.authentication.sso.enabled=true
keycloak.adapter.verify-token-audience=false	
keycloak.adapter.auth-server-url=https://xxx
keycloak.adapter.realm=yyyy
keycloak.adapter.resource=zzzz
keycloak.adapter.credentials.provider=secret
keycloak.adapter.credentials.secret=wwww
keycloak.adapter.ssl-required=external	
keycloak.adapter.autodetect-bearer-only=true
keycloak.adapter.enable-basic-auth=false&lt;/PRE&gt;&lt;P&gt;Now we have another problem regarding the&amp;nbsp;Alfresco Repository client roles (ROLE_ADMINISTRATOR, ROLE_GUEST,&amp;nbsp;GROUP_SITE_ADMINISTRATORS, ...) when we use ACS through APIs.&lt;/P&gt;&lt;P&gt;But it is another story...&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jul 2021 15:51:44 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/alfresco-keycloak-sync/m-p/143775#M38189</guid>
      <dc:creator>ilseva</dc:creator>
      <dc:date>2021-07-07T15:51:44Z</dc:date>
    </item>
  </channel>
</rss>

