public class ProtoChannelBeanPostProcessor extends Object implements org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.core.Ordered
This class is designed to work in both a load-balanced and non load-balanced environment by replacing the existing default Spring channel processors which do not work in a load balanced environment. Configuration should be done as follows in your applicationContext-security:
Deploying to a load balanced environment with SSL termination at the load balancer as well as an environment with SSL termination at Tomcat/Apache:
<bean class="org.broadleafcommerce.common.security.channel.ProtoChannelBeanPostProcessor">
<property name="channelProcessorOverrides">
<list>
<bean class="org.broadleafcommerce.common.security.channel.ProtoInsecureChannelProcessor" />
<bean class="org.broadleafcommerce.common.security.channel.ProtoSecureChannelProcessor" />
</list>
</property>
</bean>
That said, this solution only overrides the Spring Security directives but does not make any attempts to override
any invocations to ServletRequest.isSecure()
. If your application server supports it, we recommend instead using
that approach which will encapsulate any functionality encapsulated within the Proto processors. For more information
on configuring your specific servlet container, see
this issue report
ProtoSecureChannelProcessor}
,
ProtoInsecureChannelProcessor}
,
SecureChannelProcessor}
,
InsecureChannelProcessor}
Modifier and Type | Field and Description |
---|---|
protected List<org.springframework.security.web.access.channel.ChannelProcessor> |
channelProcessorOverrides |
Constructor and Description |
---|
ProtoChannelBeanPostProcessor() |
Modifier and Type | Method and Description |
---|---|
List<org.springframework.security.web.access.channel.ChannelProcessor> |
getChannelProcessorOverrides() |
int |
getOrder() |
Object |
postProcessAfterInitialization(Object bean,
String beanName) |
Object |
postProcessBeforeInitialization(Object bean,
String beanName) |
void |
setChannelProcessorOverrides(List<org.springframework.security.web.access.channel.ChannelProcessor> channelProcessorOverrides) |
protected List<org.springframework.security.web.access.channel.ChannelProcessor> channelProcessorOverrides
public Object postProcessAfterInitialization(Object bean, String beanName) throws org.springframework.beans.BeansException
postProcessAfterInitialization
in interface org.springframework.beans.factory.config.BeanPostProcessor
org.springframework.beans.BeansException
public Object postProcessBeforeInitialization(Object bean, String beanName) throws org.springframework.beans.BeansException
postProcessBeforeInitialization
in interface org.springframework.beans.factory.config.BeanPostProcessor
org.springframework.beans.BeansException
public int getOrder()
getOrder
in interface org.springframework.core.Ordered
public List<org.springframework.security.web.access.channel.ChannelProcessor> getChannelProcessorOverrides()
public void setChannelProcessorOverrides(List<org.springframework.security.web.access.channel.ChannelProcessor> channelProcessorOverrides)
channelProcessors
- the channelProcessors to setCopyright © 2022. All rights reserved.