cancel
Showing results for 
Search instead for 
Did you mean: 

LDAP import

guestbcs
Champ in-the-making
Champ in-the-making
Hi,

I've managed to import the users and groups into Alfresco. But I cannot login using those usernames. the users and groups are in the users list. I got userName not found exception. I'm not using LDAP authentication and instead are using CAS. What i planned was to import some users(not all) into Alfresco. Can i do this? I've digged further and found out that the users are not in the user store. But when i logged in using admin, i'm able to see the users in the users list. but somehow i cant login using those user ids. can someone help me? thanks


org.alfresco.repo.security.authentication.AuthenticationException: Could not find user by userName: bcs01 
at org.alfresco.repo.security.authentication.AbstractAuthenticationComponent.setCurrentUser(AbstractAuthenticationComponent.java:108)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:335)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
at $Proxy15.setCurrentUser(Unknown Source)
at customization.CASAuthenticationFilter.setAuthenticatedUser(CASAuthenticationFilter.java:177)
at customization.CASAuthenticationFilter.doFilter(CASAuthenticationFilter.java:156)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at edu.yale.its.tp.cas.client.filter.CASFilter.doFilter(CASFilter.java:401)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
Caused by: net.sf.acegisecurity.providers.dao.UsernameNotFoundException: Could not find user by userName: bcs01
at org.alfresco.repo.security.authentication.RepositoryAuthenticationDao.loadUserByUsername(RepositoryAuthenticationDao.java:116)
at org.alfresco.repo.security.authentication.AuthenticationComponentImpl.getUserDetails(AuthenticationComponentImpl.java:98)
at org.alfresco.repo.security.authentication.AbstractAuthenticationComponent.setCurrentUser(AbstractAuthenticationComponent.java:97)
… 31 more
3 REPLIES 3

andy
Champ on-the-rise
Champ on-the-rise
Hi

LDAP import only pulls in personal information. It does not get the password or inply that you can authenticate as those users. Authentication is up to your authentication service and component(s) and the web filters how they are configured. I would guess you need to configure an authentication filter to support single sign on. There are a few forum discussions about this and CAS.

Regards

Andy

guestbcs
Champ in-the-making
Champ in-the-making
Hi Andy,

I've went through several thread. the ones i followed for CAS is this
http://forums.alfresco.com/viewtopic.php?t=5893&highlight=cas

for LDAP, i tried following several guides as posted by some of the people here but one thing i noticed is almost all of them use LDAP authentication when they use ldap import. As I noticed in one of your posts, ldap authentication is not necessary as only the ldapInitialDirContextFactory are needed for the ldap import.

with CAS And ldap authentication i can do just fine. but i dont want every user to be able to access Alfresco.  so i've commented off the authentication component in ldap-authentication-context.xml and i got the error that i posted in the first post.

sorry cos i'm very slow Smiley Surprisedops:

————————————————————————————-
EDIT:

Found that the problem is after i commented of the authentication component in ldap-authentication-context, the default authenticationcomponent which is AuthenticationComponentImpl takes place. and when CAS tries to setCurrentUser(), it calls RepositoryAuthenticationDao which finds users in the usersStore which ofcourse is not there. Therefore the exception was thrown

With the LDAPAuthenticationComponentImpl, it just creates a UserDetails and returns it and does not create a user in the usersStore

How can I resolve this? Can i like..when the user tries to log in and it's not in the usersStore, it checks in the spacesStore and if there is a matching username, it creates an entry in the usersStore.. is this the right way? Or I just return a userDetail and not create it after looking it in the spacesStore? Or should I create the user when it is imported? I need some light. I'm just an intern here. All this stuff is overwhelming  :cry:

regards

andy
Champ on-the-rise
Champ on-the-rise
Hi

I suggest you keep the ldap authentication component, configure the person service not to auto create people and then use LDAP import to import only the people who should be able to use alfresco.

The unknown people will be thrown out.

If not you need to fix up the authentication filter to check if users can use alfresco. Can you pass this info through from CAS somehow?

Andy