Re: Can't login after upgrading to 1.7.3, and workaround

2015-01-26 Thread Tim Graham
I think that's a bit different from the originally reported issue, but it seems like a reasonable thing to fix if we can. On Monday, January 26, 2015 at 5:43:54 PM UTC-5, Florian Apolloner wrote: > > I can reproduce the issue: > > Log a user into the admin > Change iteration count > Use a new bro

Re: Can't login after upgrading to 1.7.3, and workaround

2015-01-26 Thread Florian Apolloner
I can reproduce the issue: Log a user into the admin Change iteration count Use a new browser (or private window) and log the same user into the admin Refresh the admin page of the first user -> login window Cheers, Florian On Thursday, January 15, 2015 at 2:31:55 AM UTC+1, Tim Graham wrote: > >

Re: Can't login after upgrading to 1.7.3, and workaround

2015-01-15 Thread Horacio G. de Oro
On Thursday, January 15, 2015 at 6:03:40 AM UTC-3, Nic West wrote: > > Authenticated returns a user instance assumably with the correct hash why > not do some thing like: > > authenticated_user.count = 0 > authenticated_user.save() Yes, I implemented that fix last night, but I really like the

Re: Can't login after upgrading to 1.7.3, and workaround

2015-01-15 Thread Nic West
Authenticated returns a user instance assumably with the correct hash why not do some thing like: authenticated_user.count = 0 authenticated_user.save() -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To

Re: Can't login after upgrading to 1.7.3, and workaround

2015-01-15 Thread James Bennett
On Thu, Jan 15, 2015 at 12:05 AM, Horacio G. de Oro wrote: > If you see the new hash in the database, I think that, maybe the admin, is > saving the user instance with the new hash. And doing that, ie: save()'ing > the user returned by authenticate() solved the issue for me too (but I > don't wan

Re: Can't login after upgrading to 1.7.3, and workaround

2015-01-14 Thread Marc Tamlyn
I think therefore you could resolve the issue by doing save(update_fields=['count']) in your code. On 15 January 2015 at 06:31, Horacio G. de Oro wrote: > Yeap. Removing the save() done in solved the issue. > > And some component is doing and update() - not a save(). I see in the > Postgresql l

Re: Can't login after upgrading to 1.7.3, and workaround

2015-01-14 Thread Horacio G. de Oro
Yeap. Removing the save() done in solved the issue. And some component is doing and update() - not a save(). I see in the Postgresql logs an UPDATE of the hash with the new increment, that includes only the "password" field. I thought that autenticate() produced a read operation on the DB... n

Re: Can't login after upgrading to 1.7.3, and workaround

2015-01-14 Thread Horacio G. de Oro
I do something like. # get the user to check tries user = User.object.get(username=username) assert user.count <= 3 # authenticate authenticated_user = authenticate(...) # auth failed if not authenticated_user: user.count++ user.save() raise

Re: Can't login after upgrading to 1.7.3, and workaround

2015-01-14 Thread Horacio G. de Oro
As part of the authentication process, I increment/reset authentication tries of the user. And to check this, I get the user from the DB before doing the authentication. I think this is causing me the issue. I reset the countre of login attempts in an instance of user that is different than the

Re: Can't login after upgrading to 1.7.3, and workaround

2015-01-14 Thread Horacio G. de Oro
I haven't tested the issue outside my project. But while debugging, I saw the new hash in the user instance returned by authenticate(), but that new hash never went to the database since I haven't done a 'save()' of the user instance. If you see the new hash in the database, I think that, maybe

Re: Can't login after upgrading to 1.7.3, and workaround

2015-01-14 Thread Tim Graham
Hi Horacio, Thanks for the report. Unfortunately, I can't reproduce this issue. My steps to reproduce using the project from the tutorial: Bump PBKDF2PasswordHasher.iterations to a higher value Login at /admin/ Confirm at /admin/auth/user/#/ that the password of the user I logged in as reflects

Can't login after upgrading to 1.7.3, and workaround

2015-01-14 Thread Horacio G. de Oro
The problem is because the iterations in PBKDF2PasswordHasher where updated to 15000, so it updates the password, but later, SessionAuthenticationMiddleware detects a password change and PUF! the login doesn't work. Right new I've created a PBKDF2PasswordHasher implementation with iteartions =