AnsweredAssumed Answered

How to know is Alfresco user logged in by LDAP or not?

Question asked by alexsolomatin on Nov 29, 2010
Latest reply on Nov 29, 2010 by alexsolomatin
Hi.

I need to get the details about user logging in. I have Alfresco NTLM authentication and LDAP authentication in my authenticatiion chain. I enabled LDAP synchronization too. How can I know in what way the user was logged in the system? Now I'm getting the all data from the properties file for LDAP authentication. And I'm trying to get the person object by PersonService and investigate whether it has the parent with the name  /{http://www.alfresco.org/model/system/1.0}system/{http://www.alfresco.org/model/system/1.0}zones/{http://www.alfresco.org/model/content/1.0}AUTH.EXT.ldap1 or not. But I can't check it. It seems I haven't got permissions for the System user for doing it. I got the exception:
16:08:17,228 ERROR [com.smartech.alfresco.module.iconnector.AlfrescoLdapController] net.sf.acegisecurity.providers.ProviderNotFoundException: No authentication provider for net.sf.acegisecurity.providers.UsernamePasswordAuthenticationToken
net.sf.acegisecurity.providers.ProviderNotFoundException: No authentication provider for net.sf.acegisecurity.providers.UsernamePasswordAuthenticationToken
   at net.sf.acegisecurity.providers.ProviderManager.doAuthentication(ProviderManager.java:169)
………………………………….
16:08:17,244 ERROR [com.smartech.alfresco.module.iconnector.AlfrescoContentObservable] net.sf.acegisecurity.providers.ProviderNotFoundException: No authentication provider for net.sf.acegisecurity.providers.UsernamePasswordAuthenticationToken
net.sf.acegisecurity.providers.ProviderNotFoundException: No authentication provider for net.sf.acegisecurity.providers.UsernamePasswordAuthenticationToken
………………………………….
16:08:17,259 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
net.sf.acegisecurity.providers.ProviderNotFoundException: No authentication provider for net.sf.acegisecurity.providers.UsernamePasswordAuthenticationToken
   at net.sf.acegisecurity.providers.ProviderManager.doAuthentication(ProviderManager.java:169)
………………………………….

Then I thried to do it on behalf of admin. I used the call of AuthenticationUtils.startSession("admin", "admin"), but got another exception:
15:29:37,125 ERROR [com.smartech.alfresco.module.iconnector.AlfrescoContentObservable] org.alfresco.webservice.util.WebServiceException: Error starting session.
org.alfresco.webservice.util.WebServiceException: Error starting session.
   at org.alfresco.webservice.util.AuthenticationUtils.startSession(AuthenticationUtils.java:94)
………………………….
Caused by: java.net.SocketTimeoutException: Read timed out
   at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
   at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:154)
   at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
   at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
   at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
   at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
   at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
   at org.apache.axis.client.Call.invoke(Call.java:2767)
   at org.apache.axis.client.Call.invoke(Call.java:2443)
   at org.apache.axis.client.Call.invoke(Call.java:2366)
   at org.apache.axis.client.Call.invoke(Call.java:1812)
   at org.alfresco.webservice.authentication.AuthenticationServiceSoapBindingStub.startSession(AuthenticationServiceSoapBindingStub.java:187)
   at org.alfresco.webservice.util.AuthenticationUtils.startSession(AuthenticationUtils.java:79)
   … 92 more
Caused by: java.net.SocketTimeoutException: Read timed out
   at java.net.SocketInputStream.socketRead0(Native Method)
   at java.net.SocketInputStream.read(SocketInputStream.java:129)
   at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
   at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
   at org.apache.axis.transport.http.HTTPSender.readHeadersFromSocket(HTTPSender.java:583)
   at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:143)
   … 103 more

Could anyone help me, please?

Outcomes