How to disable soft login in Hybris?
How to disable remember-me login in SAP Hybris?
Requirement: Every time request timeout, the user should ask for login. There shouldn't be soft login or remember me option.
Hybris OOTB behavior: In the B2B site, by default soft login is enabled. Means, users will be always auto login even session expired.
Changes Required:
- Remove default remember me (soft login) behaviour
- Remove remember me references
1. Remove default remember me (soft login) behaviour
Find file
spring-security-config.xml
located in your storefront extension. Look for beandefaultRememberMeServices
definition, in which attributealwaysRemember
has valuetrue
, that needs to be changed to false
.<alias name="defaultRememberMeServices" alias="rememberMeServices"/>
<bean id="defaultRememberMeServices" class="com.mysite.storefront.security.AcceleratorRememberMeServices" >
<property name="userDetailsService" ref="originalUidUserDetailsService" />
<property name="key" value="mysitestorefront" />
<property name="cookieName" value="mysitestorefrontRememberMe" />
<property name="alwaysRemember" value="false" />
<property name="userService" ref="userService"/>
<property name="useSecureCookie" value="true"/>
<property name="customerFacade" ref="customerFacade"/>
<property name="checkoutCustomerStrategy" ref="checkoutCustomerStrategy"/>
<property name="urlEncoderService" ref="urlEncoderService"/>
<property name="storeSessionFacade" ref="storeSessionFacade"/>
<property name="commonI18NService" ref="commonI18NService"/>
<property name="secureTokenService" ref="secureTokenService"/>
</bean>
2. Remove remember me references
Remove or comment out the below-mentioned code from the spring-security-config.xml of your storefront extension.
Remove checkbox having name _spring_security_remember_me, from your login page if it present (say
<security:remember-me key="mysitestorefront" services-ref="rememberMeServices"/>
Remove checkbox having name _spring_security_remember_me, from your login page if it present (say
login.tag
)<label><input type="checkbox" name="_spring_security_remember_me" class="checkbox" id="_spring_security_remember_me" /> Remember Login</label>
Comments
Post a Comment