Reputation: 181
Hi i hav installed the grails secuirty plugin.
But i am not able to log in i hav set this Username and Password in Bootstrap.
import dashboard.Role
import dashboard.Username
import dashboard.UsernameRole
class BootStrap {
def init = { servletContext ->
def adminRole = new Role(authority: 'ROLE_ADMIN').save(flush: true)
def usernameRole = new Role(authority: 'ROLE_USER').save(flush: true)
def Username = new Username(username: 'me', enabled: true, password: 'password')
Username.save(flush: true)
UsernameRole.create Username, adminRole, true
}
}
Upvotes: 0
Views: 107
Reputation: 964
First off, don't use the class name as a variable name, that is both wrong and ambigous. At least lowercase it, like def username
.
Secondly, you are not saving/creating the ROLE_USER one, only the admin one.
Thirdly, what errors do you get, username not found? Things to do to debug:
render Username.findAll()
to see if anything is outputUpvotes: 1