Grails Acegi插件springsecurity.GrailsDaoImpl-用户[admin]没有授权
我用Acegi0.5.1将Grails1.0.4+Acegi0.4.1项目升级到Grails1.1 我可以毫无错误地启动我的应用程序,但当我想登录时,我会收到一条“错误的用户名或密码”的消息。Grails shell输出为: 2009-04-26 12:38:46997 [403984690@qtp0-0]错误 springsecurity.GrailsDaoImpl-用户Grails Acegi插件springsecurity.GrailsDaoImpl-用户[admin]没有授权,grails,groovy,login,spring-security,Grails,Groovy,Login,Spring Security,我用Acegi0.5.1将Grails1.0.4+Acegi0.4.1项目升级到Grails1.1 我可以毫无错误地启动我的应用程序,但当我想登录时,我会收到一条“错误的用户名或密码”的消息。Grails shell输出为: 2009-04-26 12:38:46997 [403984690@qtp0-0]错误 springsecurity.GrailsDaoImpl-用户 [admin]没有授予的权限 也许有人知道我为什么不能登录?用户“admin”是在引导中创建的 我希望你能帮助我! 感谢德
[admin]没有授予的权限 也许有人知道我为什么不能登录?用户“admin”是在引导中创建的 我希望你能帮助我! 感谢德国,
whitenexx我遇到了完全相同的问题。检查以确保在BootStrap.groovy中创建用户时,首先使用密码和所有字段创建用户,即使这些字段是可选的(不确定为什么)。然后创建新角色,然后将此人添加到角色中 检查用户是否被分配到角色的一种方法是查看role_people表,该表将用户映射到角色 这是我的BootStrap.groovy文件:
class BootStrap {
// include this line to encode password for ACEGI
def authenticateService
def init = { servletContext ->
//create admin user
def password = authenticateService.passwordEncoder("password")
def superadmin = new User(username:"admin",userRealName:"Administrator",passwd:password,enabled:true,emailShow:true,description:"admin user",email:"put email here").save()
//create admin role
def sudo = new Role(authority:"ROLE_ADMIN",description:"Site Administrator")
// now add the User to the role
sudo.addToPeople(superadmin)
sudo.save()
new Role(authority:"ROLE_USER",description:"User").save()
}
def destroy = {
}
}
我遇到了完全相同的问题。检查以确保在BootStrap.groovy中创建用户时,首先使用密码和所有字段创建用户,即使这些字段是可选的(不确定为什么)。然后创建新角色,然后将此人添加到角色中 检查用户是否被分配到角色的一种方法是查看role_people表,该表将用户映射到角色 这是我的BootStrap.groovy文件:
class BootStrap {
// include this line to encode password for ACEGI
def authenticateService
def init = { servletContext ->
//create admin user
def password = authenticateService.passwordEncoder("password")
def superadmin = new User(username:"admin",userRealName:"Administrator",passwd:password,enabled:true,emailShow:true,description:"admin user",email:"put email here").save()
//create admin role
def sudo = new Role(authority:"ROLE_ADMIN",description:"Site Administrator")
// now add the User to the role
sudo.addToPeople(superadmin)
sudo.save()
new Role(authority:"ROLE_USER",description:"User").save()
}
def destroy = {
}
}
我发现了我的问题。我必须自己编辑/编码passwordEncoder()或encodePassword()方法(使用我的算法等等)。passwordEncoder()已弃用,请使用encodePassword() 我发现了我的问题。我必须自己编辑/编码passwordEncoder()或encodePassword()方法(使用我的算法等等)。passwordEncoder()已弃用,请使用encodePassword() 我曾使用过acegi,但也有类似的问题。如果使用acegi的默认编码,请调用
passwordEncoder()
。否则,您应该调用encodePassword()
我曾使用过acegi,但也有类似的问题。如果使用acegi的默认编码,请调用passwordEncoder()
。否则,您应该调用encodePassword()
我发现了我的问题。我必须自己编辑/编码passwordEncoder()或encodePassword()方法(使用我的算法等等)。passwordEncoder()已弃用,请使用encodePassword()!我发现了我的问题。我必须自己编辑/编码passwordEncoder()或encodePassword()方法(使用我的算法等等)。passwordEncoder()已弃用,请使用encodePassword()!