Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-29170

Fix user creation during the first Keycloak authentication

    XMLWordPrintable

    Details

      Description

      The first authentication with Keycloak which also creates the user in the user directory if it does not exist fails with this error

      2020-05-27T21:51:22,083 ERROR [nuxeo-error-log] org.nuxeo.ecm.directory.DirectoryException: The document cannot be updated because its id is missing
      	at org.nuxeo.ecm.directory.BaseSession.updateEntry(BaseSession.java:406)
      	at org.nuxeo.ecm.platform.usermanager.UserManagerImpl.updateUser(UserManagerImpl.java:1412)
      	at org.nuxeo.ecm.platform.usermanager.UserManagerImpl.updateUser(UserManagerImpl.java:1044)
      	at org.nuxeo.ecm.platform.ui.web.keycloak.KeycloakUserMapper.updateUser(KeycloakUserMapper.java:151)
      	at org.nuxeo.ecm.platform.ui.web.keycloak.KeycloakUserMapper.lambda$getOrCreateAndUpdateNuxeoPrincipal$0(KeycloakUserMapper.java:73)
      	at org.nuxeo.runtime.api.Framework.doPrivileged(Framework.java:293)
      	at org.nuxeo.ecm.platform.ui.web.keycloak.KeycloakUserMapper.getOrCreateAndUpdateNuxeoPrincipal(KeycloakUserMapper.java:61)
      	at org.nuxeo.usermapper.service.UserMapperComponent.getOrCreateAndUpdateNuxeoPrincipal(UserMapperComponent.java:110)
      	at org.nuxeo.usermapper.service.UserMapperComponent.getOrCreateAndUpdateNuxeoPrincipal(UserMapperComponent.java:104)
      	at org.nuxeo.ecm.platform.ui.web.keycloak.KeycloakAuthenticationPlugin.handleRetrieveIdentity(KeycloakAuthenticationPlugin.java:128)
      	at org.nuxeo.ecm.platform.ui.web.auth.NuxeoAuthenticationFilter.handleRetrieveIdentity(NuxeoAuthenticationFilter.java:1146)
      	at org.nuxeo.ecm.platform.ui.web.auth.NuxeoAuthenticationFilter.doFilterInternal(NuxeoAuthenticationFilter.java:549)
      	at org.nuxeo.ecm.platform.ui.web.auth.NuxeoAuthenticationFilter.doFilter(NuxeoAuthenticationFilter.java:430)
       

      Problem comes from the fact that the user document model which is created is not used to update the directory entry.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour
                1h