jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antonio Gioia <antonio.gioi...@gmail.com>
Subject [LDAP: error code 49 - Invalid Credentials]
Date Tue, 10 Apr 2012 12:59:38 GMT
Hi to all,

I have tried to configure the LdapLoginModule as follows:

  <Security appName="Jackrabbit">
	<SecurityManager class="org.apache.jackrabbit.core.DefaultSecurityManager"
workspaceName="security">

                               
                               
                                
      	</SecurityManager>



      	<AccessManager
class="org.apache.jackrabbit.core.security.DefaultAccessManager">
                               
       	</AccessManager>


                <LoginModule
class="com.sun.security.auth.module.LdapLoginModule">
                                  < param name="userProvider"
value="ldap://my_url/" />
                                  <para m name="authIdentity"
value="uid={USERNAME}" />
                                  <para m name="useSSL" value="false" />
                </LoginModule>

    </Security> 

I tried to access to repository as follows:

 Repository repository =  new TransientRepository();
        
     Session session =  (SessionImpl)repository.login(new
SimpleCredentials("ldap_user", "psw".toCharArray()));
        session.getRootNode();

throwing the follow exception:


Exception in thread "main" javax.jcr.LoginException: Cannot bind to LDAP
server
	at
org.apache.jackrabbit.core.RepositoryImpl.login(RepositoryImpl.java:1514)
	at
org.apache.jackrabbit.core.TransientRepository.login(TransientRepository.java:380)
	at
org.apache.jackrabbit.commons.AbstractRepository.login(AbstractRepository.java:123)
	at
org.sample.nodedefinition.jackrabbitNodeDefinition.TestACL.main(TestACL.java:54)
Caused by: javax.security.auth.login.FailedLoginException: Cannot bind to
LDAP server
	at
com.sun.security.auth.module.LdapLoginModule.attemptAuthentication(LdapLoginModule.java:756)
	at
com.sun.security.auth.module.LdapLoginModule.login(LdapLoginModule.java:551)
	at
org.apache.jackrabbit.core.security.authentication.LocalAuthContext.login(LocalAuthContext.java:86)
	at
org.apache.jackrabbit.core.RepositoryImpl.login(RepositoryImpl.java:1497)
	... 3 more
Caused by: javax.naming.AuthenticationException: [LDAP: error code 49 -
Invalid Credentials]
	at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3041)
	at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2987)
	at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2789)
	at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2703)
	at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:293)
	at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:175)
	at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:193)
	at
com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:136)
	at
com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:66)
	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
	at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
	at javax.naming.InitialContext.init(InitialContext.java:223)
	at javax.naming.ldap.InitialLdapContext.<init>(InitialLdapContext.java:134)
	at
com.sun.security.auth.module.LdapLoginModule.attemptAuthentication(LdapLoginModule.java:753)

Perhaps the LdapLoginModule configuration is wrong...

Thanks for assistance. 





--
View this message in context: http://jackrabbit.510166.n4.nabble.com/LDAP-error-code-49-Invalid-Credentials-tp4545514p4545514.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Mime
View raw message