You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Aaron Evans <aa...@yahoo.ca> on 2005/10/30 19:49:18 UTC

[J2] LDAP Authentication Problems

Ok, so I just built J2 from source using a mysql database for authentication.
Everything works fine, J2 starts up no problem.

So, then as indicated by:
http://portals.apache.org/jetspeed-2/multiproject/jetspeed-security/config.html
#LDAP_Configuration

I did the following:
1. deleted security-spi-atn.xml from src/webapp/WEB-INF/assembly

2. Copied security-spi-ldap-atn.xml and security-spi-ldap.xml from 
components/security/etc to src/webapp/WEB-INF/assembly

3. I copied ldap.properties to src/webapp/WEB-INF/conf from 
components/security/etc even though this was not specified in the instructions 
because that is where security-spi-ldap.xml says to look for it.

4. I put my LDAP config params in ldap.properties.

5. I patched src/webapp/WEB-INF/assembly/security-spi-ldap-atn.xml since there
are two incorrect class names in there:

org.apache.jetspeed.security.spi.impl.ldap.LdapCredentialHandler
org.apache.jetspeed.security.spi.impl.ldap.LdapUserSecurityHandler

should be:

org.apache.jetspeed.security.spi.impl.LdapCredentialHandler
org.apache.jetspeed.security.spi.impl.LdapUserSecurityHandler

6. Then I did a 'maven -o allClean allBuild' and a 'maven -o j2:quickStart'.

But, when I startup tomcat, I see the error below in the log:

org.springframework.beans.factory.BeanDefinitionStoreException: Error 
registering bean with name 
'org.apache.jetspeed.tools.pamanager.servletcontainer.ApplicationServerManager' 
defined in ServletContext resource [/WEB-INF/assembly/deployment.xml]: Could 
not resolve placeholder 'autodeployment.server'


The autodeployment.server property is definitely defined in the 
jetspeed.properties file in WEB-INF/conf in the deployed application.  And
this works when I don't use the ldap config and use the default DB config.

I don't see how changing the Credential and UserSecurity handlers have to do 
with the deployment.xml configs, but somehow this change produces this error.
(I have built it twice now in each configuration just to confirm it).

Can someone shed some light on this for me?

thx,
aaron


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: [J2] LDAP Authentication Problems

Posted by Aaron Evans <aa...@yahoo.ca>.
Aaron Evans <aaronmevans <at> yahoo.ca> writes:

> Now, the spring framework error I get (well the root cause one anyway) is:
> 
> org.springframework.beans.factory.BeanCreationException: Error creating bean 
> with name 'org.apache.jetspeed.security.spi.UserSecurityHandler' defined in 
> ServletContext resource [/WEB-INF/assembly/security-spi-ldap-atn.xml]: 1 
> constructor arguments specified but no matching constructor found in bean 
> 'org.apache.jetspeed.security.spi.UserSecurityHandler' (hint: specify index 
> arguments for simple parameters to avoid type ambiguities)
> 

Ah, the problem is that in the security-spi-ldap-atn.xml file, the
org.apache.jetspeed.security.spi.UserSecurityHandler bean's constructor
was being passed a 
org.apache.jetspeed.security.spi.impl.ldap.LdapUserCredentialDao
when it should be passed a 
org.apache.jetspeed.security.spi.impl.ldap.LdapUserPrincipalDao.

The fix then is to setup a LdapUserPrincipalDao bean (using the
LdapUserPrincipalDaoImpl implementation) and pass it in for the constructor
arg.  The constructor args for the LdapUserPrincipalDaoImpl are the same
as for the LdapUserCredentialDaoImpl.








---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: [J2] LDAP Authentication Problems

Posted by Aaron Evans <aa...@yahoo.ca>.
Aaron Evans <aaronmevans <at> yahoo.ca> writes:

> 
> The autodeployment.server property is definitely defined in the 
> jetspeed.properties file in WEB-INF/conf in the deployed application.  And
> this works when I don't use the ldap config and use the default DB config.
> 
> I don't see how changing the Credential and UserSecurity handlers have to do 
> with the deployment.xml configs, but somehow this change produces this error.
> (I have built it twice now in each configuration just to confirm it).
> 
> Can someone shed some light on this for me?
> 
> thx,
> aaron
> 

As an update to this, if I leave the default security-spi-atn.xml in place and
only install the ldap.properties file and the security-spi-ldap.xml file, then
this error will occur.

The security-spi-ldap.xml file just defines a spring 
PropertyPlaceholderConfigurer bean for the ldap properties. So it looks as
though a second PropertyPlaceholderConfigurer interferes with the other. So 
is this a bug with the spring framework?

I tried hard-coding the ldap parameters into security-spi-ldap.xml and not
using the other files (thereby omitting the PropertyPlaceholderConfigurer) 
but then I get another bean creation error in the spring framework. :(

Same thing if i put the ldap parameters into jetspeed.properties.  And I 
don't use the other PropertyPlaceholderConfigurer.

Now, the spring framework error I get (well the root cause one anyway) is:

org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'org.apache.jetspeed.security.spi.UserSecurityHandler' defined in 
ServletContext resource [/WEB-INF/assembly/security-spi-ldap-atn.xml]: 1 
constructor arguments specified but no matching constructor found in bean 
'org.apache.jetspeed.security.spi.UserSecurityHandler' (hint: specify index 
arguments for simple parameters to avoid type ambiguities)

I don't see anything wrong with how the construct arg is specified:

<bean id="org.apache.jetspeed.security.spi.UserSecurityHandler" 
class="org.apache.jetspeed.security.spi.impl.LdapUserSecurityHandler"
abstract="false" singleton="true" lazy-init="default" autowire="default" 
dependency-check="default">
  <constructor-arg>
  <ref 
bean="org.apache.jetspeed.security.spi.impl.ldap.LdapUserCredentialDao" /> 
  </constructor-arg>
</bean>

Can someone please tell me what the problem is here?


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org