I have added the following in applicationContext-security.xml
Code: Select all
<sec:authentication-manager alias="blMyUserAuthenticationManager">
<sec:authentication-provider user-service-ref="blMyUserDetailsService">
<sec:password-encoder ref="blMyPasswordEncoder">
<sec:salt-source ref="blMySaltSource" />
</sec:password-encoder>
</sec:authentication-provider>
</sec:authentication-manager>
Code: Select all
<!-- Sets the login failure URL -->
<bean id="blMyAuthenticationFailureHandler" class="org.broadleafcommerce.common.security.BroadleafAuthenticationFailureHandler">
<constructor-arg value="/login?error=true" />
<property name="redirectStrategy" ref="blAuthenticationFailureRedirectStrategy" />
</bean>
<!-- Sets the login success URL -->
<bean id="blMyAuthenticationSuccessHandler" class="org.broadleafcommerce.core.web.order.security.BroadleafAuthenticationSuccessHandler">
<property name="redirectStrategy" ref="blAuthenticationSuccessRedirectStrategy" />
<property name="defaultTargetUrl" value="/" />
<property name="targetUrlParameter" value="successUrl" />
<property name="alwaysUseDefaultTargetUrl" value="false" />
</bean>
Code: Select all
<sec:form-login login-page='/login/myUser'
authentication-success-handler-ref="blMyUserAuthenticationSuccessHandler"
authentication-failure-handler-ref="blMyUserAuthenticationFailureHandler"
login-processing-url="/myUserLogin_post.htm" />
Do I need to add anything else? I have a doubt on how to add sec:logout
<sec:logout delete-cookies="ActiveID" invalidate-session="true" logout-url="/logout"/>
- What is this ActiveID?
Also how to implement my own success and failure handlers?
Thanks in advance. Hope you will reply as soon as possible.