grailsspring-mvcspring-securitywaffle

Is there a way to add a third party servlet in a grails application?


I'm new to grails and wondering whether there is a way to add a third party servlet in a grails application?

I'm trying to use Waffle with grails. I was successfully able to use Waffle in an MVC app using spring security as described here: https://github.com/dblock/waffle/blob/master/Docs/spring/SpringSecurityAuthenticationProvider.md

In my MVC app I was able to add beans like this for authentication:

<bean id="waffleNegotiateSecurityFilter" class="waffle.spring.NegotiateSecurityFilter">
    <property name="provider" ref="waffleSecurityFilterProviderCollection"/>
    <property name="allowGuestLogin" value="false"/>
    <property name="principalFormat" value="fqn"/>
    <property name="roleFormat" value="both"/>
</bean>

Solution

  • You have to add filters mapping to web.xml

    install web.xml using grails command

    > grails install-templates
    

    Than edit web.xml file (inside src/templates )

    and add the mapping as stated by the documentation you showed us.

    Then add beans definition to grails resources

    /conf/spring/resources.groogy
    

    Translating xml bean definition to grails spring groovy DSL can be a little difficult. If you have any problem refear to the guide about grails and spring or ask here.