|
Hi,
I have a question about acegi plugin. I'm trying to change a user's password on bootstrap, but when I login with the user, it says the password is invalid. Is there anything special I need to do in order to update a user's password?
I can only create users on bootstrap if there are no users. Thanks, Miguel Ping
|
|
Hi
I have some bootstrap code that looks like this: person1.passwd = authenticateService.passwordEncoder("mmm").toString() person1.addToAuthorities(userRole)
person1.save() John 2009/5/24 Miguel Ping <[hidden email]> Hi, -- http://interlated.com.au 0434 996 607 |
|
Similarly, this is how I seed my dev app in bootstrap: def userRole = new Authority(authority:"ROLE_USER", description:"user level access").save() def person = new Person(username:"dave", userRealName:"Dave Richards", enabled:true, email:"[hidden email]", passwd:authenticateService.encodePassword("1234") ) userRole.addToPeople(person) person.addToAuthorities(userRole) userRole.save() person.save() Dave On 24/05/2009, at 10:00 , john robens wrote: Hi |
|
I'm not being able to get it working, although my users version field are increased every time bootstrap runs.
How can I trace acegi login ?
I have: debug 'org.codehaus.groovy.grails.plugins.acegi'
within my configuration file, but it seems to take no effect on logging. On Sun, May 24, 2009 at 1:11 AM, <[hidden email]> wrote:
|
|
Can you post your BootStrap code?
org.grails.plugins.springsecurity org.springframework.security > I'm not being able to get it working, although my users version field are > increased every time bootstrap runs.How can I trace acegi login ? > I have: > debug 'org.codehaus.groovy.grails.plugins.acegi' > > within my configuration file, but it seems to take no effect on logging. > > > On Sun, May 24, 2009 at 1:11 AM, <[hidden email]> wrote: > > > Similarly, this is how I seed my dev app in bootstrap: > > > > def userRole = new Authority(authority:"ROLE_USER", description:"user level > > access").save() > > def person = new Person(username:"dave", userRealName:"Dave Richards", > > enabled:true, > > email:"[hidden email]", > > passwd:authenticateService.encodePassword("1234") ) > > userRole.addToPeople(person) > > person.addToAuthorities(userRole) > > userRole.save() > > person.save() > > > > Dave > > > > > > On 24/05/2009, at 10:00 , john robens wrote: > > > > Hi > > I have some bootstrap code that looks like this: > > > > > > person1.passwd = authenticateService.passwordEncoder("mmm").toString() > > person1.addToAuthorities(userRole) > > person1.save() > > > > John > > > > 2009/5/24 Miguel Ping <[hidden email]> > > > >> Hi, > >> I have a question about acegi plugin. > >> > >> I'm trying to change a user's password on bootstrap, but when I login with > >> the user, it says the password is invalid. Is there anything special I need > >> to do in order to update a user's password? > >> > >> I can only create users on bootstrap if there are no users. > >> > >> Thanks, > >> Miguel Ping > >> > > > > > > > > -- > > http://interlated.com.au > > 0434 996 607 > > > > > > > |
|
the logs show me a 'Bad Credentials' message.
Here's my bootstrap: (just relevant lines) def adminUser = User.findByUsername('mping') ?: new User()
adminUser.passwd = authenticateService.encodePassword("lalalala") ... def adminRole = Role.findByAuthority('ROLE_ADMIN') ?: new Role(authority: 'ROLE_ADMIN', description: 'admin'); adminRole.save() if (!adminRole.containsUser(adminUser.username)) adminRole.addToPeople(adminUser) else adminRole.getUser(adminUser.username).properties = adminUser.properties
adminUser.save() adminRole.save() My problem is that the user already exists. I want the bootstrap to update an existing user's pass or create a new one, and do the same for the requestmaps and roles.
On Mon, May 25, 2009 at 3:15 PM, Burt Beckwith <[hidden email]> wrote:
|
|
I finally managed to solve the problem. It was a combination of other problems such as copy paste, calling save() on wrong objects, etc:
Thanks all
On Mon, May 25, 2009 at 3:46 PM, Miguel Ping <[hidden email]> wrote: the logs show me a 'Bad Credentials' message. |
| Powered by Nabble | Edit this page |
