Reputation: 747
I tried to update simple project from grails 2.4.2 to 3.2.0 and seems everything works except spring security.
The problem is that /login/auth page always redirects to /login/auth?login_error=1 even if corrected user from BootStrap.groovy trying to login:
BootStrap.groovy
def init = { servletContext ->
def adminRole = new Role(authority: 'ROLE_ADMIN').save(flush: true)
def testUser = new Person(username: 'me', password: 'password')
testUser.save(flush: true)
PersonRole.create testUser, adminRole, true
}
application.groovy
grails.plugin.springsecurity.logout.postOnly = false
grails.plugin.springsecurity.userLookup.userDomainClassName = 'simple.Role.Person'
grails.plugin.springsecurity.userLookup.authorityJoinClassName = 'simple.Role.PersonRole'
grails.plugin.springsecurity.authority.className = 'simple.Role'
grails.plugin.springsecurity.securityConfigType = "InterceptUrlMap"
grails.plugin.springsecurity.interceptUrlMap = [
[pattern: '/', access: ['permitAll']],
[pattern: '/error', access: ['permitAll']],
[pattern: '/index', access: ['permitAll']],
[pattern: '/index.gsp', access: ['permitAll']],
[pattern: '/shutdown', access: ['permitAll']],
[pattern: '/assets/**', access: ['permitAll']],
[pattern: '/**/js/**', access: ['permitAll']],
[pattern: '/**/css/**', access: ['permitAll']],
[pattern: '/**/images/**', access: ['permitAll']],
[pattern: '/**/favicon.ico', access: ['permitAll']],
[pattern: '/login/**', access: ['permitAll']],
[pattern: '/logout/**', access: ['permitAll']],
[pattern: '/simple/**', access: ['ROLE_ADMIN']]
]
Please point the right direction - where can be the issue?
Upvotes: 0
Views: 758
Reputation: 747
Problem was in custom login and logout gsp. New version has no compatibility, need to re-create it. Deleting login.gsp/logout.gsp solved the issue.
Upvotes: 1