cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to override bean in hac web context

0 Likes
1,306

I have a requirement to override the CoreAuthenticationProvider for hac. The bean for this is in the web context of hac. How can I override this bean and inject into the web context of hac.

Hybris version is 5.6

Accepted Solutions (1)

Accepted Solutions (1)

0 Likes

I am able to achieve this with following steps.

  1. Created MyCoreAuthenticationProvider which extends CoreAuthenticationProvider in the mycore extension.

  2. Created a myhac-spring-security.xml in the mycore extension which contains the customized bean.

      <beans:property name="preAuthenticationChecks" ref="corePreAuthenticationChecks" />
         <beans:property name="userDetailsService" ref="coreUserDetailsService" />
     </beans:bean>
    
    
  3. Created a import.xml and imported the myhac-spring-security.xml in it.

  4. Then added the below property in project.properties file of mycore extension hac.additionalWebSpringConfigs.mycore=classpath:/mycore/hac/spring/import.xml

arvind-kumar_avinash
Active Contributor
0 Likes

You can accept your own answer for it to be more easily locatable.

0 Likes

The code snippet in point #2 is not complete. Please find attachment which has link textthe complete code.

Answers (0)