Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I ended up having to declare both the form-login and the remember-me tags explicitly and declare them in the filter chain.</p> <p>so instead of the tag and the tag I had to declare the respective filters as beans, configure them accordingly and then define them in their respective position in the filterchain with the tag. (If you use custom-filter tags and the explicit tags you get spring errors during startup time).</p> <p>Here's what works for me:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:security="http://www.springframework.org/schema/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd"&gt; &lt;security:http pattern="/_ui/**" security="none" /&gt; &lt;!-- Default security config --&gt; &lt;security:http disable-url-rewriting="true" entry-point-ref="gymAuthenticationEntryPoint"&gt; &lt;!-- using custom login filter config and rememberme filter config --&gt; &lt;security:custom-filter ref="gymRememberMeFilter" position="REMEMBER_ME_FILTER"/&gt; &lt;security:custom-filter ref="gymAuthenticationFilter" position="FORM_LOGIN_FILTER"/&gt; &lt;security:anonymous username="anonymous" granted-authority="ROLE_ANONYMOUS" /&gt; &lt;!-- session stealing is prevented by using secure GUID cookie --&gt; &lt;security:session-management session-fixation-protection="none" /&gt; &lt;!-- SSL / AUTHENTICATED pages --&gt; &lt;security:intercept-url pattern="/my-account*" access="ROLE_CUSTOMERGROUP" requires-channel="https" /&gt; &lt;!-- omitting intercept definitions for readability --&gt; &lt;!-- use explicit FORM_LOGIN_FILTER (see above) and entry-point (see entry-point-ref in http tag) instead of form-login definition &lt;security:form-login login-page="/login" authentication-failure-handler-ref="loginAuthenticationFailureHandler" authentication-success-handler-ref="loginGuidAuthenticationSuccessHandler" /&gt; --&gt; &lt;security:logout logout-url="/logout" success-handler-ref="logoutSuccessHandler" /&gt; &lt;security:port-mappings&gt; &lt;security:port-mapping http="#{configurationService.configuration.getProperty('tomcat.http.port')}" https="#{configurationService.configuration.getProperty('tomcat.ssl.port')}" /&gt; &lt;security:port-mapping http="80" https="443" /&gt; &lt;!--security:port-mapping http="#{configurationService.configuration.getProperty('proxy.http.port')}" https="#{configurationService.configuration.getProperty('proxy.ssl.port')}" /--&gt; &lt;/security:port-mappings&gt; &lt;security:request-cache ref="httpSessionRequestCache" /&gt; &lt;/security:http&gt; &lt;security:authentication-manager alias="authenticationManager"&gt; &lt;security:authentication-provider ref="acceleratorAuthenticationProvider" /&gt; &lt;security:authentication-provider ref="rememberMeAuthenticationProvider" /&gt; &lt;/security:authentication-manager&gt; &lt;bean id="acceleratorAuthenticationProvider" class="org.jnj.storefront.security.AcceleratorAuthenticationProvider" scope="tenant"&gt; &lt;property name="userDetailsService" ref="gymUserDetailService" /&gt; &lt;property name="adminGroup" value="ROLE_ADMINGROUP"/&gt; &lt;property name="userService" ref="userService"/&gt; &lt;property name="gymCustomerLoginService" ref="defaultGymCustomerLoginService"/&gt; &lt;/bean&gt; &lt;bean id="gymUserDetailService" class="org.jnj.storefront.security.services.impl.GymCoreUserDetailsService" scope="tenant"&gt; &lt;property name="baseDao" ref="asyBaseDao" /&gt; &lt;/bean&gt; &lt;bean id="coreUserDetailsService" class="de.hybris.platform.spring.security.CoreUserDetailsService" scope="tenant" /&gt; &lt;!-- Login Success Handlers --&gt; &lt;bean id="loginGuidAuthenticationSuccessHandler" class="org.jnj.storefront.security.GUIDAuthenticationSuccessHandler" scope="tenant"&gt; &lt;property name="authenticationSuccessHandler" ref="loginAuthenticationSuccessHandler" /&gt; &lt;property name="guidCookieStrategy" ref="guidCookieStrategy" /&gt; &lt;/bean&gt; &lt;bean id="loginAuthenticationSuccessHandler" class="org.jnj.storefront.security.StorefrontAuthenticationSuccessHandler" scope="tenant"&gt; &lt;property name="customerFacade" ref="customerFacade" /&gt; &lt;property name="defaultTargetUrl" value="/my-account"/&gt; &lt;property name="useReferer" value="true"/&gt; &lt;property name="alwaysUseDefaultTargetUrl" value="false"/&gt; &lt;property name="requestCache" ref="httpSessionRequestCache" /&gt; &lt;/bean&gt; &lt;bean id="loginCheckoutGuidAuthenticationSuccessHandler" class="org.jnj.storefront.security.GUIDAuthenticationSuccessHandler" scope="tenant"&gt; &lt;property name="authenticationSuccessHandler" ref="loginCheckoutAuthenticationSuccessHandler" /&gt; &lt;property name="guidCookieStrategy" ref="guidCookieStrategy" /&gt; &lt;property name="defaultGymCartFacade" ref="gymCartFacade"/&gt; &lt;/bean&gt; &lt;bean id="loginCheckoutAuthenticationSuccessHandler" class="org.jnj.storefront.security.StorefrontAuthenticationSuccessHandler" scope="tenant"&gt; &lt;property name="customerFacade" ref="customerFacade" /&gt; &lt;property name="defaultTargetUrl" value="/checkout/single/summary"/&gt; &lt;/bean&gt; &lt;!-- Login Failure Handlers --&gt; &lt;bean id="loginAuthenticationFailureHandler" class="org.jnj.storefront.security.LoginAuthenticationFailureHandler"&gt; &lt;property name="defaultFailureUrl" value="/login?error=auth"/&gt; &lt;property name="accountBlockedUrl" value="/login?error=blocked"/&gt; &lt;property name="passwordMigrationUrl" value="/login?error=migration"/&gt; &lt;/bean&gt; &lt;bean id="loginCheckoutAuthenticationFailureHandler" class="org.jnj.storefront.security.LoginAuthenticationFailureHandler"&gt; &lt;property name="defaultFailureUrl" value="/login/checkout?error=auth"/&gt; &lt;property name="accountBlockedUrl" value="/login/checkout?error=blocked"/&gt; &lt;property name="passwordMigrationUrl" value="/login/checkout?error=migration"/&gt; &lt;/bean&gt; &lt;!-- Logout Success Handler --&gt; &lt;bean id="logoutSuccessHandler" class="org.jnj.storefront.security.StorefrontLogoutSuccessHandler" scope="tenant"&gt; &lt;property name="defaultTargetUrl" value="/?logout=true"/&gt; &lt;property name="guidCookieStrategy" ref="guidCookieStrategy"/&gt; &lt;property name="cmsSiteService" ref="cmsSiteService"/&gt; &lt;/bean&gt; &lt;!-- remember me services --&gt; &lt;bean id="rememberMeServices" class="org.springframework.security.web.authentication.rememberme.TokenBasedRememberMeServices"&gt; &lt;property name="userDetailsService" ref="gymUserDetailService"/&gt; &lt;property name="key" value="someprivatekey"/&gt; &lt;!-- must match the rememberMeAuthenticationProvider key --&gt; &lt;property name="parameter" value="rememberMe" /&gt;&lt;!-- must match the parameter in the login form --&gt; &lt;property name="cookieName" value="JNJ_RMMBRM" /&gt; &lt;property name="useSecureCookie" value="false" /&gt; &lt;!-- if set to true "remember me" only gets detected when accessed via https --&gt; &lt;property name="tokenValiditySeconds" value="31536000" /&gt; &lt;!-- 1 year --&gt; &lt;/bean&gt; &lt;bean id="rememberMeAuthenticationProvider" class="org.springframework.security.authentication.RememberMeAuthenticationProvider"&gt; &lt;property name="key" value="someprivatekey"/&gt; &lt;/bean&gt; &lt;bean id="gymRememberMeFilter" class="org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter"&gt; &lt;property name="rememberMeServices" ref="rememberMeServices"/&gt; &lt;property name="authenticationManager" ref="authenticationManager" /&gt; &lt;property name="authenticationSuccessHandler" ref="loginGuidAuthenticationSuccessHandler"/&gt; &lt;/bean&gt; &lt;!-- login filter and entry point --&gt; &lt;bean id="gymAuthenticationFilter" class="org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter"&gt; &lt;property name="authenticationManager" ref="authenticationManager"/&gt; &lt;property name="filterProcessesUrl" value="/j_spring_security_check"/&gt; &lt;property name="rememberMeServices" ref="rememberMeServices"/&gt; &lt;property name="authenticationSuccessHandler" ref="loginGuidAuthenticationSuccessHandler"/&gt; &lt;property name="authenticationFailureHandler" ref="loginAuthenticationFailureHandler"/&gt; &lt;/bean&gt; &lt;bean id="gymAuthenticationEntryPoint" class="org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint"&gt; &lt;property name="loginFormUrl" value="/login"/&gt; &lt;/bean&gt; </code></pre> <p></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload