Quantcast

Changing passwords on bootstrap

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Changing passwords on bootstrap

Miguel Ping
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Changing passwords on bootstrap

john robens
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Changing passwords on bootstrap

dave-389
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

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Changing passwords on bootstrap

Miguel Ping
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


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Changing passwords on bootstrap

burtbeckwith
Can you post your BootStrap code?


You can turn up logging for these packages/categories to get more info about what's going on:


org.codehaus.groovy.grails.plugins.springsecurity
org.grails.plugins.springsecurity
org.springframework.security


Burt


On Monday 25 May 2009 8:36:52 am Miguel Ping wrote:
> 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
> >
> >
> >
>



signature.asc (204 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Changing passwords on bootstrap

Miguel Ping
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:
Can you post your BootStrap code?


You can turn up logging for these packages/categories to get more info about what's going on:


org.codehaus.groovy.grails.plugins.springsecurity
org.grails.plugins.springsecurity
org.springframework.security


Burt


On Monday 25 May 2009 8:36:52 am Miguel Ping wrote:
> 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
> >
> >
> >
>



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Changing passwords on bootstrap

Miguel Ping
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.

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:
Can you post your BootStrap code?


You can turn up logging for these packages/categories to get more info about what's going on:


org.codehaus.groovy.grails.plugins.springsecurity
org.grails.plugins.springsecurity
org.springframework.security


Burt


On Monday 25 May 2009 8:36:52 am Miguel Ping wrote:
> 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
> >
> >
> >
>




Loading...