开发者

sharing authentication across multiple plugins in Grails

开发者 https://www.devze.com 2023-01-16 02:17 出处:网络
开发者_StackOverflow社区I have modularized a large Grails project into several plugins and want to share access to the spring security plugin to manage authentication across my project - is there an e
开发者_StackOverflow社区

I have modularized a large Grails project into several plugins and want to share access to the spring security plugin to manage authentication across my project - is there an easy way to do this? I'm not sure how to share access to core project plugins from sub plugins


If you use spring security grails plugin for your authentication, then just define this plugin in your base-sub-plugin, like this:

grails.project.dependency.resolution = {
    [..]
    plugins {
        compile ":spring-security-core:1.1.3"
        compile ":spring-security-ui:0.1.2"     
    }
}

All your your custom plugins, that use this plugin, will automatically get the security plugin as a dependency and can use the springSecurityService (and do not need to define these plugins in there application.properties).

0

精彩评论

暂无评论...
验证码 换一张
取 消