10-04-2016 06:08 AM
Hi,
I'd like to get a user's last login date. I searched the forum, and based on this thread (Re: get last login? ), it appears that I have two solutions to do this: enable audit (which seems a bit overkill to just get the last login date), or create a new aspect and extend the LoginBean to update the user's properties on authentication.
I created a custom LoginBean, but I am not able to find which configuration file I should update/create to use this custom bean in place of the default one. The link provided in the thread I am refferring to seems to be out of date. Can anyone point me in the right direction? FYI, I'm working on Alfresco 5.1.
Many thanks!
Sylvain.
10-04-2016 11:55 AM
You're right.
You can try overwriting following Spring bean:
<bean id="authenticationComponent" class="org.alfresco.repo.security.authentication.AuthenticationComponentImpl">
by using your customised class:
<bean id="authenticationComponent" class="com.foo.repo.security.authentication.LoggerAuthenticationComponentImpl">
and then override that authenticateImpl() method extending from org.alfresco.repo.security.authentication.AuthenticationComponentImpl
10-04-2016 06:19 PM
I've wrote a quick sample to include a custom authenticator for login as first component in authentication chain. Please, check GitHub - angelborroy/alfresco-logger-authenticator: Custom authenticator for Alfresco It's not perfect, but can be used as reference.
Probably it's a better idea to implement Axel Faust approach, but I have no experience on that kind of customisation.
10-04-2016 10:01 PM
Almost like this,But Audit component is recommended.
Audit component provides feature to track user activities include user login .And Audit data is accessible via the AuditService ,audit web scripts,So you don't need to implement your own.It is less intrusive than cusomized authentication.
Alfresco's default audit configuration already persists login success, login failure and logout events data.But it also persist more other data for general use.
If you only need login data,you can customize your configuration using alfresco-audit-example-login.xml.sample as an example.
About how to customize audit ,you can refer to http://docs.alfresco.com/5.1/references/dev-extension-points-audit.html
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.