Bug 576303

Summary: No response control for a grace login
Product: Red Hat Enterprise Linux 7 Reporter: Aaron Hagopian <airhead1>
Component: 389-ds-baseAssignee: Noriko Hosoi <nhosoi>
Status: CLOSED WORKSFORME QA Contact: Viktor Ashirov <vashirov>
Severity: low Docs Contact:
Priority: low    
Version: 7.0CC: jgalipea, mreynolds, nhosoi, nkinder, rmeggins
Target Milestone: rc   
Target Release: 7.3   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-16 15:19:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 495079, 512820, 690319    

Description Aaron Hagopian 2010-03-23 18:58:14 UTC
In developing a Java application using 389 directory as a back-end mainly for authentication, I've hit a problem which I feel is a bug.  Starting with a user logging in and their password is no where near expiring, when they login there are no response controls sent back.  Next when a user logins and their password is in the warning period, the server returns 2.16.840.1.113730.3.4.5 in the response after successful login which is great.  I can warn people that their password is expiring soon.

Separately if a password is reset using ldappasspwd for example, on login, the server responds both 2.16.840.1.113730.3.4.5 and 2.16.840.1.113730.3.4.4 meaning the password is expiring and expired which is also good.

Now going back to the first part when the password finally expires and they haven't changed their password yet, and we have grace logins on (allowing up to 3 logins after password expires for example), on login the server does not return 2.16.840.1.113730.3.4.5 or 2.16.840.1.113730.3.4.4.  Therefore it seems like their password is not expiring soon or expired.

I would think the server would return both similar to the password reset example or at least 2.16.840.1.113730.3.4.4 noting the password is expired.  Instead the only way I can tell the password is expiring during this period is to check the passwordExpiredTime attribute myself versus the server constraints.

Comment 2 Martin Kosek 2012-01-04 13:32:02 UTC
Upstream ticket:
https://fedorahosted.org/389/ticket/89

Comment 5 mreynolds 2016-06-16 15:19:38 UTC
 Testing with ldapmodify, the number of grace logins is returned, as well as the password being marked as expired. Note the "-e ppolicy" which requests the password response control. It must be requested or it is not returned:

ldapsearch -D "uid=mark,dc=example,dc=com" -w password -b "dc=example,dc=com" -xLLL -e ppolicy uid=mark +
ldap_bind: Success (0) (Password expired, 1 grace logins remain)
dn: uid=mark,dc=example,dc=com
passwordExpirationTime: 20150616175346Z
passwordExpWarned: 1
passwordGraceUserTime: 4
entrydn: uid=mark,dc=example,dc=com

Closing as works for me.