03-22-2023 10:31 PM
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?
03-23-2023 03:40 AM
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
03-23-2023 08:45 PM
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>
03-24-2023 12:14 AM
It should be "authenticationService":
03-24-2023 04:35 AM
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
Explore our Alfresco products with the links below. Use labels to filter content by product module.