mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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:
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user