I am exploring Lock user account on unsuccessfull attempts.
I found below properties and its working
authentication.protection.enabled=true
authentication.protection.limit=3
authentication.protection.periodSeconds=900
One more extra steps I want to do here is sending email to user on account lock.
I found java file(AuthenticationServiceImpl.java) where account lock logic is there but I am not getting idea how can I override that and write down my email send logic.
Any one have any idea about override?
You can override this method from AuthenticationServiceImpl:
You may use following approach to override AuthenticationService Spring bean:
https://github.com/Acosix/alfresco-utility/blob/master/docs/Common-Spring-Processors.md
Thanks for answer.
I have a idea about class and method for my custom logic but not gettign idea how to override as I am not able to find bean.
Could you provide some basic idea to implement post processor for AuthenticationServiceImpl.
Trying below way but not getting idea for targetBeanName.
<bean class="de.acosix.alfresco.utility.common.spring.ImplementationClassReplacingBeanFactoryPostProcessor"> <property name="targetBeanName" value="" /> <property name="originalClassName" value="org.alfresco.repo.security.authentication.AuthenticationServiceImpl" /> <property name="replacementClassName" value="org.alfresco.repo.security.authentication.MyAuthenticationServiceImpl" /> <property name="enabled" value="true" /> </bean>
It should be "authenticationService":
I configured below way but not working. Correct me if I am doing wrong way.
I am using alfresco sdk for customizations.
service-context.xml
<bean class="de.acosix.alfresco.utility.common.spring.ImplementationClassReplacingBeanFactoryPostProcessor"> <!-- Spring placeholder can be used and will be transparently resolved from configured Spring resolvers + property sources --> <property name="enabled" value="true" /> <property name="targetBeanName" value="authenticationService" /> <property name="originalClassName" value="org.alfresco.repo.security.authentication.AuthenticationServiceImpl" /> <property name="replacementClassName" value="org.alfresco.repo.security.authentication.CustomAuthenticationServiceImpl" /> </bean>
public class CustomAuthenticationServiceImpl extends AuthenticationServiceImpl { }
I have included ImplementationClassReplacingBeanFactoryPostProcessor class and other classes where it has dependency.
Below I have tried to check and it is working whereas I did same thing for AuthenticationServiceImpl but not working.
I just created constructor to check, class is loading or not. MyInvitationServiceImpl constructor is loading during sdk start but AuthenticationServiceImpl constructor not loading.
<bean class="de.axelfaust.examples.beans.ImplementationClassReplacingBeanFactoryPostProcessor"> <property name="targetBeanName" value="invitationService" /> <property name="originalClassName" value="org.alfresco.repo.invitation.InvitationServiceImpl" /> <property name="replacementClassName" value="org.alfresco.repo.invitation.MyInvitationServiceImpl" /> <property name="enabled" value="true" /> </bean>
It is not reaching to CustomAuthenticationServiceImpl
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.