Return consistent expiration message for forms-based login

We need to inform users when a forms-based login fails due to the
password needing to be reset. Currently there is no way to distinguish
a reset case vs an incorrect password.

This will bind the user using a simple LDAP bind over ldapi (by default)
and if that is successful, check the expiration date against the current
time.

The UI portion of this that uses this message will come later.

https://fedorahosted.org/freeipa/ticket/2608
This commit is contained in:
Rob Crittenden
2012-04-13 15:19:32 -04:00
parent 6f7224f252
commit 7b515bddbc
2 changed files with 42 additions and 4 deletions

View File

@@ -102,11 +102,12 @@ def test_unauthorized_error():
s = StartResponse()
assert_equal(
f.unauthorized(None, s, 'unauthorized'),
f.unauthorized(None, s, 'unauthorized', 'password-expired'),
[t % dict(message='unauthorized')]
)
assert s.status == '401 Unauthorized'
assert s.headers == [('Content-Type', 'text/html; charset=utf-8')]
assert s.headers == [('Content-Type', 'text/html; charset=utf-8'),
('X-IPA-Rejection-Reason', 'password-expired')]
def test_params_2_args_options():