开发者

Grails Spring Security plugin: logout not working

开发者 https://www.devze.com 2023-03-04 16:32 出处:网络
I just add the spring-security-plugin to my grails project. everything looks working fine. but when I try to logout the app shows me the logout message, however the application is still logged-in!

I just add the spring-security-plugin to my grails project. everything looks working fine. but when I try to logout the app shows me the logout message, however the application is still logged-in!

My Config files is the following:

// A开发者_如何学运维dded by the Spring Security Core plugin:
grails.plugins.springsecurity.useBasicAuth = true
grails.plugins.springsecurity.userLookup.userDomainClassName = 'malibu.server.User'
grails.plugins.springsecurity.userLookup.authorityJoinClassName = 'malibu.server.UserRole'
grails.plugins.springsecurity.authority.className = 'malibu.server.Role'

cheers


Since you're using Basic auth, your browser must be caching your credentials and logging you back in.


Just session.invalidate() before redirect.

class LogoutController {
    /**
     * Index action. Redirects to the Spring security logout uri.
     */
    def index = {
            session.invalidate()
            redirect [whatever]
    }
}
0

精彩评论

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

关注公众号