Arthur Neves
Arthur Neves

Reputation: 12128

Grails Spring Security plugin: logout not working

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:

// Added 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

Upvotes: 3

Views: 5556

Answers (2)

Gonzalo Clavell
Gonzalo Clavell

Reputation: 51

Just session.invalidate() before redirect.

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

Upvotes: 5

Burt Beckwith
Burt Beckwith

Reputation: 75671

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

Upvotes: 6

Related Questions