How to put two different login pages?
Posted: Wed Jul 02, 2014 8:10 am
I have two different set of users and hence two different login pages in two different urls. Two separate tables for two different types of users, and everything is different for those set of users i.e. the DAO, Services etc. I would also want to change the way, I hash their passwords.
I have added the following in applicationContext-security.xml
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"/>
Thanks in advance. Hope you will reply as soon as possible.
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.