Enforce payment password uniqueness¶
IsUniquePaymentPWD guards against a user setting their payment password to the same value as either their existing payment password or their AD login password. It composes Validate payment password with a live authentication attempt to check the login-password condition.
| Field | Value |
|---|---|
| Operation ID | OP-SU-10 |
| Trigger | Caller calls clsSystemUser.IsUniquePaymentPWD(inPaymentPwd, inPlatform) |
| Inputs | inPaymentPwd candidate payment password; inPlatform a clsSecurityPrincipal.Platform value used to construct a temporary authentication context |
| Outputs | Boolean uniqueness result |
| Primary components | clsSystemUser.IsUniquePaymentPWD(...), clsSystemUser.CheckPaymentPWD(...), clsSecurityPrincipal |
| Entry point | Business\SAIF.Business.Security.SystemUser\clsSystemUser.vb |
Steps¶
- Check against the stored payment password.
isUniqueis initialized by negating the result of Validate payment password (Not CheckPaymentPWD(inPaymentPwd)) — a match against the stored payment password immediately makes the candidate non-unique (BR-009). - Short-circuit on a payment-password match. If step 1 already found the candidate matches the stored payment password (
isUnique = False), the login-password check in the next step is skipped entirely. - Check against the login password. If
isUniqueis stillTrue, the method constructs a temporaryclsSecurityPrincipal(inPlatform), sets itsDomainto the current object's domain, itsUserNameto the currentUserID, and itsPasswordto the candidate payment password. - Attempt authentication. The temporary principal's
IsAuthenticatedresult is evaluated. A successful authentication means the candidate payment password also works as the login password, soisUniqueis set toNot tempSecPrinc.IsAuthenticated(BR-010). - Discard the temporary principal.
tempSecPrincis set toNothingafter the authentication attempt. - Return the outcome. The method returns
isUnique—Trueonly when the candidate matches neither the stored payment password nor the login password.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([Caller calls IsUniquePaymentPWD]) --> CheckPay[CheckPaymentPWD candidate]
CheckPay --> PayMatch{Matches stored payment password?}
PayMatch -->|Yes| NotUnique([Return False - matches payment password])
PayMatch -->|No| BuildPrinc[Build temporary clsSecurityPrincipal with candidate as password]
BuildPrinc --> Auth[Attempt IsAuthenticated]
Auth --> LoginMatch{Authenticated as login password?}
LoginMatch -->|Yes| NotUniqueLogin([Return False - matches login password])
LoginMatch -->|No| Unique([Return True - unique])
Failure and edge-case behavior¶
- The login-password check performs a live authentication attempt against the directory using the candidate as a password; this has the same latency and dependency characteristics as a normal login and will fail closed (non-unique treated as
False... actually returns uniqueTrue) only when authentication genuinely does not succeed.* - If the payment-password check alone already disqualifies the candidate, the method never attempts the authentication call — the two checks are not always both executed.
- The temporary
clsSecurityPrincipalconstruction depends oninPlatformbeing a valid value recognized by the framework; an unsupported platform value's effect on the authentication attempt is not defined in this method.**
Related documentation¶
Note: Statements marked with
*were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with**could not be confirmed; treat as unknown until verified.
Sources¶
Business\SAIF.Business.Security.SystemUser\clsSystemUser.vb