grails install-templateswill do the trick. Navigate to the src/templates/war and add the filter to the web.xml template there:
Acegi Channel Processing Filter
org.springframework.security.util.FilterToBeanProxy
targetClass
org.springframework.security.securechannel.ChannelProcessingFilter
Acegi Channel Processing Filter
/*
Now, when we build our application, this filter will be configured in our deployed web.xml.
The final step is to set up the spring beans, and this is done using the Grails DSL for configuring Spring beans (the SpringBuilder). A great reference on the SpringBuilder can be found on the Grails documentation online (http://grails.org/Spring+Bean+Builder). The code should be put into yout grails-app/conf/spring/resource.groovy file (the entire file is reproduced here):
import org.springframework.security.securechannel.ChannelProcessingFilter
import org.springframework.security.securechannel.ChannelDecisionManagerImpl
import org.springframework.security.securechannel.SecureChannelProcessor
import org.springframework.security.securechannel.InsecureChannelProcessor
beans = {
secureChannelProcessor(SecureChannelProcessor)
insecureChannelProcessor(InsecureChannelProcessor)
channelDecisionManager(ChannelDecisionManagerImpl) {
channelProcessors = [secureChannelProcessor, insecureChannelProcessor]
}
channelProcessingFilter(ChannelProcessingFilter) {
channelDecisionManager=channelDecisionManager
filterInvocationDefinitionSource='''
CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
PATTERN_TYPE_APACHE_ANT
/login/**=REQUIRES_SECURE_CHANNEL
'''
}
}
Add your own comment below.
Previous entry: IPTV and the Next Generation Television Experience