<?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: Duplicate Keycloak Users with ADF in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/duplicate-keycloak-users-with-adf/m-p/142502#M37924</link>
    <description>&lt;P&gt;Hi Fsanna,&lt;/P&gt;
&lt;P&gt;try to set the scope in this way in the app.config.json&lt;/P&gt;
&lt;PRE&gt;"scope": "openid profile email"&lt;/PRE&gt;
&lt;P&gt;Here's a &lt;A href="https://auth0.com/docs/get-started/apis/scopes/openid-connect-scopes" target="_blank" rel="noopener nofollow noreferrer"&gt;link&lt;/A&gt;&amp;nbsp;to some documentation.&lt;/P&gt;
&lt;P&gt;My guess is that keycloak is sending to ACS only the openid Identifier and ACS creates a new user because the id is unknown.&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Leo Mattioli&lt;/P&gt;</description>
    <pubDate>Mon, 04 Mar 2024 07:08:09 GMT</pubDate>
    <dc:creator>LeoMattioli</dc:creator>
    <dc:date>2024-03-04T07:08:09Z</dc:date>
    <item>
      <title>Duplicate Keycloak Users with ADF</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/duplicate-keycloak-users-with-adf/m-p/142501#M37923</link>
      <description>&lt;P&gt;Hello, I'm trying to set up ACS Community Version (SDK 4.7) to use Keycloak as Identity Service, and to use ADF to manage the authentication and authorization process in my UI app.&lt;/P&gt;&lt;P&gt;I managed to set everything up using different guides and my app actually connects to ACS and manages Keycloak users correctly, adding them to the `people` container of ACS.&lt;/P&gt;&lt;P&gt;Unfortunately, I got a problem which has already been asked some years ago in the forum, i.e. &lt;A href="https://hub.alfresco.com/t5/alfresco-content-services-forum/keycloak-and-duplicate-users/td-p/306217" target="_self" rel="nofollow noopener noreferrer"&gt;this thread&lt;/A&gt;. My Keycloak users are being duplicated when they login for the first time in the UI application. I can be sure about this since the admin node repository presents two entries for the same user.&lt;BR /&gt;This happens only when the user login for the very first time; the next ones, it does not duplicate it anymore.&lt;/P&gt;&lt;P&gt;Nevertheless, I get this error in the ACS logs:&lt;/P&gt;&lt;PRE&gt;INFO  [security.person.PersonServiceImpl] [http-nio-8080-exec-7] Splitting 1 duplicate person objects.
ERROR [util.transaction.TransactionSupportUtil] [http-nio-8080-exec-7] After completion (committed) exception
rg.alfresco.repo.security.permissions.AccessDeniedException: 02010242 Only users with ROLE_ADMINISTRATOR are allowed to manage users.&lt;/PRE&gt;&lt;P&gt;and this error appears everytime the user login, even if it is not duplicated anymore.&lt;/P&gt;&lt;P&gt;As I said before, I'm using ADF to connect to ACS, and I'm defining the file `app.config.json` in the following way:&lt;/P&gt;&lt;PRE&gt;{
    "$schema": "../node_modules/@alfresco/adf-core/app.config.schema.json",
    "ecmHost": "{protocol}//{hostname}{:port}",
    "providers": "ECM",
    "authType": "OAUTH",
    "identityHost": "http://localhost/keycloak/realms/myrealm",
    "oauth2": {
        "host": "http://localhost/keycloak/realms/myrealm",
        "clientId": "myclient",
        "scope": "openid",
        "secret": "",
        "implicitFlow": true,
        "silentLogin": true,
        "redirectUri": "/home",
        "redirectUriLogout": "/",
        "redirectSilentIframeUri": "/assets/silent-check-sso.html"
    },
    "application": {
        "name": "Alfresco ADF Application"
    },
    "languages": [
        {
            "key": "en",
            "label": "English"
        },
        {
            "key": "it",
            "label": "Italian"
        }
    ],
    "logLevel": "trace"
}&lt;/PRE&gt;&lt;P&gt;while the ACS properties for connecting to Keycloak are the following ones:&lt;/P&gt;&lt;PRE&gt;authentication.chain=identity-service1:identity-service,alfrescoNtlm1:alfrescoNtlm
identity-service.enable-basic-auth=false
identity-service.auth-server-url=http://${HOST_IP}/keycloak
identity-service.realm=${REALM_NAME}
identity-service.resource=${CLIENT_NAME}
identity-service.credentials.provider=secret
identity-service.credentials.secret=${CLIENT_SECRET}
identity-service.authentication.enabled=true
identity-service.authentication.sso.enabled=true
identity-service.ssl-required=external
identity-service.autodetect-bearer-only=true&lt;/PRE&gt;&lt;P&gt;Has there been any solution on how to solve this problem?&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 12:05:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/duplicate-keycloak-users-with-adf/m-p/142501#M37923</guid>
      <dc:creator>fsanna</dc:creator>
      <dc:date>2024-03-01T12:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate Keycloak Users with ADF</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/duplicate-keycloak-users-with-adf/m-p/142502#M37924</link>
      <description>&lt;P&gt;Hi Fsanna,&lt;/P&gt;
&lt;P&gt;try to set the scope in this way in the app.config.json&lt;/P&gt;
&lt;PRE&gt;"scope": "openid profile email"&lt;/PRE&gt;
&lt;P&gt;Here's a &lt;A href="https://auth0.com/docs/get-started/apis/scopes/openid-connect-scopes" target="_blank" rel="noopener nofollow noreferrer"&gt;link&lt;/A&gt;&amp;nbsp;to some documentation.&lt;/P&gt;
&lt;P&gt;My guess is that keycloak is sending to ACS only the openid Identifier and ACS creates a new user because the id is unknown.&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Leo Mattioli&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2024 07:08:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/duplicate-keycloak-users-with-adf/m-p/142502#M37924</guid>
      <dc:creator>LeoMattioli</dc:creator>
      <dc:date>2024-03-04T07:08:09Z</dc:date>
    </item>
  </channel>
</rss>

