Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-18755

Exception when using LDAP Password attribute

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Automatically Closed
    • Affects Version/s: 3.28.1
    • Fix Version/s: None
    • Component/s: LDAP
    • Labels:
    • Story Points:
      3

      Description

      Issue description

      When I try to configure Password attribute to be some custom attribute the following exception is thrown:

      org.sonatype.nexus.extdirect.internal.ExtDirectServlet - Failed to invoke action method: ldap_LdapServer.verifyLogin, java-method: org.sonatype.nexus.ldap.internal.ui.LdapServerComponent.verifyLogin
      java.lang.Exception: Failed to connect to LDAP Server: java.lang.String cannot be cast to [B
             at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
             at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
             at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
             at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
             at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
             at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
             at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:250)
             at org.sonatype.nexus.ldap.internal.ui.LdapServerComponent.verifyLogin(LdapServerComponent.groovy:252)
             at com.palominolabs.metrics.guice.ExceptionMeteredInterceptor.invoke(ExceptionMeteredInterceptor.java:49)
             at com.palominolabs.metrics.guice.TimedInterceptor.invoke(TimedInterceptor.java:47)
             at org.sonatype.nexus.validation.internal.ValidationInterceptor.invoke(ValidationInterceptor.java:53)
             at org.apache.shiro.guice.aop.AopAllianceMethodInvocationAdapter.proceed(AopAllianceMethodInvocationAdapter.java:49)
      ...

      How to reproduce

      • set-up simple local LDAP (e.g. OpenLDAP)
      • run Nexus OSS repo
      • create LDAP configuration in Nexus
      • set Password attribute (e.g. description - attribute type shouldn't matter that much IMO)
      • try to login using Verify Login => error about String to byte array conversion is displayed

       

      Expected behavior

      Either the password attribute needs to be handled as string all the way, or there has to be possibility how to force binary type (e.g. ;binary JNDI option, which does not work). However my suspicion is that this issue has nothing to do with the type returned by JNDI and there is simply type casting issue inside groovy source code (which is not publicly available afaik).

       

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            pavel.horal Pavel Horal
            Last Updated By:
            Sonatype Support Sonatype Support
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response:

                tigCommentSecurity.panel-title