简体   繁体   中英

Grails Spring Security Core Plugin

I am (finally) upgrading my Acegi plugin to Spring Security Core. At the same time, I am upgrading from Grails 1.3.7 to 2.0. My site was fully functional before, but now when I try to get to my default page (which is IS_AUTHENTICATED_ANONYMOUSLY ) I am redirected to the auth action of my LoginController . This method was never invoked with Acegi, so I don't know what the problem is. Have I set up my configuration wrong or is there something else I need to be thinking about?

grails.plugins.springsecurity.securityConfigType = SecurityConfigType.InterceptUrlMap

    grails.plugins.springsecurity.interceptUrlMap  = [
                '/blog/**':['IS_AUTHENTICATED_ANONYMOUSLY'],
                '/static/**':['IS_AUTHENTICATED_ANONYMOUSLY'],
                '/consensus/**':['IS_AUTHENTICATED_FULLY'],
                '/login/**':['IS_AUTHENTICATED_ANONYMOUSLY'],
                '/signup/**':['IS_AUTHENTICATED_ANONYMOUSLY'],
                '/home/**':['IS_AUTHENTICATED_FULLY'],
                '/test/**':['ROLE_ADMIN'],
                '/admin/**':['ROLE_ADMIN'],
                '/adminmanage/**':['ROLE_ADMIN'],
                '/quartz/**':['ROLE_ADMIN'],
                '/**/*.css':['IS_AUTHENTICATED_ANONYMOUSLY'],
                '/js/**':['IS_AUTHENTICATED_ANONYMOUSLY'],
                '/images/**':['IS_AUTHENTICATED_ANONYMOUSLY'],
                '/monitoring**':['ROLE_ADMIN'],
                '/**':['IS_AUTHENTICATED_FULLY']
            ]

My UrlMappings.groovy is:

class UrlMappings {
    static mappings = {
        "/"(controller:"x", action:"y")
        "/z/?"(controller:"x", action:"y")
        "/$controller/$action?/$id?"
                {
                    constraints {
                        // apply constraints here
                    }
                }
        "500"(view: '/error')
    }
}

I have been reading through the documentation but am having some problems, so I am not sure if there is more relevant code one would need to see. If there is, please let me know and I will add it. Thanks.

Other options in my Config.groovy were incorrect and this caused the problem. Once I corrected them everything worked fine.

Despite it being called out in the documentation, I had security fields that were not prepended with grails.plugins.springsecurity This caused the engine not to recognize them, which for some reason resulted in the call to auth .

After remove openid plugin all requests redirects me to the login page! I don't know what to do... I've already remove everything related.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM