cancel
Showing results for 
Search instead for 
Did you mean: 

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

alexsolomatin
Champ on-the-rise
Champ on-the-rise
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/{htt... 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?
1 REPLY 1

alexsolomatin
Champ on-the-rise
Champ on-the-rise
So, if someone is interested in it, I solved the problem after investigation these links:
http://forums.alfresco.com/en/viewtopic.php?t=15684
http://forums.alfresco.com/en/viewtopic.php?f=11&t=1046
All what I needed was to use "unproxied" SearchService and NodeService by determination the type of user.