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

Fix LDAP directory on schema with type restriction (email)

    XMLWordPrintable

    Details

    • Tags:
    • Backlog priority:
      1,000
    • Sprint:
      nxFG 9.1.3

      Description

      1. install HF19
      2. setup ldap with Nuxeo and specify the mail attribute
      3. try to login with administrator and search users -> this generates an 500 error
      4. attempt to log in as a normal user it also generates a 500 error:
        2017-01-02 14:50:19,396 ERROR [http-bio-0.0.0.0-80-exec-47] [org.nuxeo.ecm.platform.web.common.exceptionhandling.DefaultNuxeoExceptionHandler] javax.servlet.ServletException: Field type not supported in directories: email#anonymousType
        	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:659)
        	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
        	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        ...
        Caused by: org.nuxeo.ecm.directory.DirectoryException: Field type not supported in directories: email#anonymousType
        	at org.nuxeo.ecm.directory.ldap.LDAPSession.getFieldValue(LDAPSession.java:768)
        	at org.nuxeo.ecm.directory.ldap.LDAPSession.ldapResultToDocumentModel(LDAPSession.java:924)
        	at org.nuxeo.ecm.directory.ldap.LDAPSession.getEntryFromSource(LDAPSession.java:261)
        	at org.nuxeo.ecm.directory.DirectoryCache.getEntry(DirectoryCache.java:122)
        
      5. this happens when the email attribute is filled in (either correctly or wrongly)
      6. this is due to the fact the LDAPSession.getFieldValue method does not know email#anonymousType.
      7. this is indroduced by fix NXP-20500 adding a constraint on the mail attribute
      8. adding name="string" to the type seems to fix the issue:
          <xs:element name="email">
            <xs:simpleType name="string">
              <xs:restriction base="xs:string">
                <!-- the same pattern is used in userinfo.xsd -->
                <xs:pattern value="[^@]+@[^\.]+\..+" />
              </xs:restriction>
            </xs:simpleType>
          </xs:element>
        
      9. It seems also the new type is present in 2 locations:
        https://github.com/nuxeo/nuxeo/commit/00b67e98d92f50dcbb2a24b65b756faa79854dca
        https://github.com/nuxeo/nuxeo/commit/b07a3e680d229b165ac2e208a2b7a7c866db4af4

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 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 - 45 minutes
                  45m