dunn less
dunn less

Reputation: 623

Grails spring-security-core plugin

Is it possible to modify and let grails spring-security-core plugin utilize other beans defined in e.g /WEB-INF/applicationContext-security.xml?

Has anyone successfully been able to run for example a minimalistic case of spring-security:

<http>
    <http-basic/>
    <intercept-url pattern="/**" access="ROLE_ADMIN" />
</http>
<authentication-manager>
    <authentication-provider>
        <user-service>
            <user name="admin" password="pass" authorities="ROLE_ADMIN" />
        </user-service>
    </authentication-provider>
</authentication-manager>

Having Grails spring-security-core plugin installed, so that the grails plugin does not redirect it and use its own beans instead?

In that case, where and how do you specify this in order to make this possible?

Upvotes: 0

Views: 642

Answers (1)

Burt Beckwith
Burt Beckwith

Reputation: 75671

Don't edit /WEB-INF/applicationContext-security.xml - this is the Grails parent application context definition file. If you want to use XML syntax instead of resources.groovy, create a file called resources.xml in the same folder and put the bean definitions there. The format is the same as any Spring XML file.

But you can't mix Spring Security XML bean definitions with the plugin's, since the approach is very different, in particular several bean names are not the same.

Upvotes: 2

Related Questions