cancel
Showing results for 
Search instead for 
Did you mean: 

Single sign on

joserra
Champ in-the-making
Champ in-the-making
Hello,
We are working on liferay-alfreso SSO.  We have developed our class IntegrationAccessLiferayAuthenticationFilter based on IChains example.

But when we try to:

setAuthenticatedUser(req, httpSess, userName);
where userName we know it exits (because if we enter to alfresco by login.jsp we are authenticated).

We get this exception:

15:38:45,893 ERROR [app.servlet.IntegrationAccessLiferayAuthenticationFilter] AuthenticationException:
org.alfresco.repo.security.authentication.AuthenticationException: Could not find user by userName: joserra
        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 $Proxy32.setCurrentUser(Unknown Source)
        at org.alfresco.web.app.servlet.IntegrationAccessLiferayAuthenticationFilter.setAuthenticatedUser(IntegrationAccessLiferayAuthenticationFilter.java:254)
        at org.alfresco.web.app.servlet.IntegrationAccessLiferayAuthenticationFilter.doFilter(IntegrationAccessLiferayAuthenticationFilter.java:214)
        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.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: joserra
        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)
        … 27 more

We have changed:

       authComponent = (AuthenticationComponent) ctx.getBean("AuthenticationComponent");
        authService = (AuthenticationService) ctx.getBean("AuthenticationService");

as it is said in http://forums.alfresco.com/viewtopic.php?p=19600 to use transactional services.

Why the user is not being found on authentication when we access in the filter?
2 REPLIES 2

joserra
Champ in-the-making
Champ in-the-making
Ok, now it works, but we can´t use "chaining-authentication-context.xml" to validate users that are not in our LDAP.
So returning "ldap-authentication-context.xml" as was configured to use users of LDAP without "ldap-authentication-context.xml" works.

Can someone explain what the different auth method used when chaining is activated? Because all I can see is that there are MORE methods to authenticate, but the repo users should see the same… don´t know.

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

This is an issue as there is no chaining authentication component. This has now been added.

The issue is authenticationComponent is used in various places and will wire up the alfresco implemenation which does a check for the user as well as the person. Other implementations could be wired up that do not check (e.g. the LDAP instance) or you can now use the chaning auth component as well as the auth service.

Andy