In our spring application we're authenticating users against a Windows AD server. When any user has its credentials expired a form is shown so he/she can change its password. Before updating it in AD, we're checking if its account is lockedout, so we're verifying if the account attribute "lockoutTime" is bigger than 0.
We are using this lockoutTime verification in some other places of the platform without problems, but when the credentials are expired it seems that lockoutTime gets also the time when they expired, although the account is not actually locked.
How could we verify this difference: user is locked when lockoutTime is bigger than 0, except if its credentials have expired (or anything else) ?
Edit: Not the same that this question (or some similar others), where its asked about looking for locked accounts only. My problem is that the lockedTimeout attribute is not enough as it could be also setted to another number different to 0 when the user has its password expired. The password is expired, but the account is not locked, but lockoutTime is > 0.