[web2py] Re: Auto Creating Users/Groups/Roles

2010-04-22 Thread Patrick
Bookmarked. On Apr 22, 1:24 pm, Thadeus Burgess wrote: > I just wrote a blog post on this! > > http://groups.google.com/group/web2py/browse_thread/thread/1a522db61b... > > -- > Thadeus > > > > On Thu, Apr 22, 2010 at 1:12 PM, Patrick wrote: > > > On Apr 22, 12:18 pm, Jonathan Lundell wrote: > >

Re: [web2py] Re: Auto Creating Users/Groups/Roles

2010-04-22 Thread Thadeus Burgess
I just wrote a blog post on this! http://groups.google.com/group/web2py/browse_thread/thread/1a522db61b5e5d44 -- Thadeus On Thu, Apr 22, 2010 at 1:12 PM, Patrick wrote: > > > On Apr 22, 12:18 pm, Jonathan Lundell wrote: >> On Apr 22, 2010, at 9:32 AM, Patrick wrote: >> >> > I'm sorry your

[web2py] Re: Auto Creating Users/Groups/Roles

2010-04-22 Thread Patrick
On Apr 22, 12:18 pm, Jonathan Lundell wrote: > On Apr 22, 2010, at 9:32 AM, Patrick wrote: > > > I'm sorry your solution *does* work, I misread it in the reply, the > > formatting got off and I was treating it like a separate variable. So > > it works! When you first start web2py the user gets c

Re: [web2py] Re: Auto Creating Users/Groups/Roles

2010-04-22 Thread Jonathan Lundell
On Apr 22, 2010, at 9:32 AM, Patrick wrote: > I'm sorry your solution *does* work, I misread it in the reply, the > formatting got off and I was treating it like a separate variable. So > it works! When you first start web2py the user gets created (and every > time the user gets deleted as well. I

[web2py] Re: Auto Creating Users/Groups/Roles

2010-04-22 Thread Patrick
On Apr 22, 11:03 am, mdipierro wrote: > ticket_master = db.auth_user.insert(first_name=fname, >                                  last_name=lname, >                                  email=maile, > > password=db.auth_user.password.requires[0](passwd)[0])) > > unless you have a custom auth_user mod

[web2py] Re: Auto Creating Users/Groups/Roles

2010-04-22 Thread mdipierro
ticket_master = db.auth_user.insert(first_name=fname, last_name=lname, email=maile, password=db.auth_user.password.requires[0](passwd)[0])) unless you have a custom auth_user model. In that case depdends on the password validator(

Re: [web2py] Re: Auto Creating Users/Groups/Roles

2010-04-22 Thread Jonathan Lundell
On Apr 22, 2010, at 7:55 AM, Patrick wrote: > > > On Apr 21, 10:09 pm, Jonathan Lundell wrote: >> On Apr 21, 2010, at 7:09 PM, mdipierro wrote: >> >>> NO. You cannot use >> >>> password=IS_CRYPT()(passwd)[0]) >> >>> You must use >> >>> password=db.auth_user.password.requires[0](passwd)[0])

[web2py] Re: Auto Creating Users/Groups/Roles

2010-04-22 Thread Patrick
On Apr 21, 10:09 pm, Jonathan Lundell wrote: > On Apr 21, 2010, at 7:09 PM, mdipierro wrote: > > > NO. You cannot use > > > password=IS_CRYPT()(passwd)[0]) > > > You must use > > > password=db.auth_user.password.requires[0](passwd)[0]) > > > the reason is that IS_CRYPT() by default uses MD5 whil

[web2py] Re: Auto Creating Users/Groups/Roles

2010-04-22 Thread Patrick
On Apr 21, 10:41 pm, mdipierro wrote: > It is crytical that the my_hmac_key in your example be the same as > auth.settings.hmac_key > > On Apr 21, 10:09 pm, Jonathan Lundell wrote: > > > > > On Apr 21, 2010, at 7:09 PM, mdipierro wrote: > > > > NO. You cannot use > > > > password=IS_CRYPT()(pas

[web2py] Re: Auto Creating Users/Groups/Roles

2010-04-21 Thread mdipierro
It is crytical that the my_hmac_key in your example be the same as auth.settings.hmac_key On Apr 21, 10:09 pm, Jonathan Lundell wrote: > On Apr 21, 2010, at 7:09 PM, mdipierro wrote: > > > NO. You cannot use > > > password=IS_CRYPT()(passwd)[0]) > > > You must use > > > password=db.auth_user.pass

Re: [web2py] Re: Auto Creating Users/Groups/Roles

2010-04-21 Thread Jonathan Lundell
On Apr 21, 2010, at 7:09 PM, mdipierro wrote: > NO. You cannot use > > password=IS_CRYPT()(passwd)[0]) > > You must use > > password=db.auth_user.password.requires[0](passwd)[0]) > > the reason is that IS_CRYPT() by default uses MD5 while if you pass a > key IS_CRYPT(key='sha521:blabla') is us

[web2py] Re: Auto Creating Users/Groups/Roles

2010-04-21 Thread mdipierro
NO. You cannot use password=IS_CRYPT()(passwd)[0]) You must use password=db.auth_user.password.requires[0](passwd)[0]) the reason is that IS_CRYPT() by default uses MD5 while if you pass a key IS_CRYPT(key='sha521:blabla') is uses better algorithms (for example hmac+sha512). So to encrypt the p

[web2py] Re: Auto Creating Users/Groups/Roles

2010-04-21 Thread rohfle
You probably need to 'crypt' the password before inserting it into the database. This can be done using something like: pw_hasher = IS_CRYPT() ticket_master = db.auth_user.insert(first_name=fname, last_name=lname, email=maile,

Re: [web2py] Re: Auto Creating Users/Groups/Roles

2010-04-21 Thread Thadeus Burgess
How about password = CRYPT()(passwd)[0] -- Thadeus On Wed, Apr 21, 2010 at 6:54 PM, mdipierro wrote: >    ticket_master = db.auth_user.insert(first_name=fname, >                                last_name=lname, >                                email=maile, >                                pa

[web2py] Re: Auto Creating Users/Groups/Roles

2010-04-21 Thread mdipierro
ticket_master = db.auth_user.insert(first_name=fname, last_name=lname, email=maile, password=passwd) should be ticket_master = db.auth_user.insert(first_name=fname,