Posts

Showing posts with the label hybris developer

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 bean defaultRememberMeServices  definition, in which attribute alwaysRemember  has value true , 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="or

How to enable Remember me functionality in SAP Hybris?

Requirement:  While login, the user should have the option ( remember me checkbox ). If the user has selected checkbox, he/she should not ask to login again till remember me cookie expired. Hybris OOTB behaviour:  In the B2B site, there no remembers me checkbox, by default internally it's always selected. Means, soft login will work for all users. But Hybris also has a concept, Hard Login which matches secure  GUID  stored in session and cookie for all secured URL having the @RequireHardLogIn annotation. Changes Required: Remove default remember me (soft login) behaviour Add remember me checkbox in the login page Change Hard login behaviour, to regenerate  GUID  if auto-login perform for the current request. 1. Remove default remember me (soft login) behaviour Find file spring-security-config.xml located in your storefront extension. Look for bean defaultRememberMeServices definition, in which attribute alwaysRemember has value true , that needs to be changed to

How to debug Hybris application?

As Hybris runs in builin server, you can debug it as Remote Java Application from Eclipse start the server with  hybrisserver.bat debug  (In windows) or  ./hybrisserver.sh debug  (In Linux) Import all required  extensions  in eclipse Open any Java file ( cartPageController.java ) Open  Run > Debug Configurations  (shortcut:  Alt + r + b ) check for  Remote Java Application  in your left panel of popup Right click on  Remote Java Applicaiton  and click on new Create a new configuration by clicking on  Apply Click on  Debug  to start your  debug mode Nowe enjoys the debugging by putting breakpoints.

How to add script tag or source code in hybris WCMS component ?

Requirement : To enable google structure data for Organization and WebSite search I want to add the script (application/ld+json) on Hybris homepage using WCMS component. Problem : I have chosen the paragraph component and added it to the one of available WCMS slot. But not able to add a script in the editor, as XSS filter remove script while saving to DB. Workaround : Disable XSS filter for while using  xss.filter.enable= false  (from hac), save the script (editor > select source > past your script) and then agian enable the xss filter. Structure data application/ld+json: <script type='application/ld+json'>  {   "@context": "http://www.schema.org",   "@type": "Organization",   "name": "MyCompnay USA, Inc.",   "url": "https://www.MyCompnayusa.com/",     "logo": "http://www.MyCompnayusa.com/web/media/system/layout/images/logo.gif",