Hi Krishna,

Thanks for the update and for working through everything so thoroughly. I
applied both PRs on current trunk again and re-tested with MFA enabled,
disabled, and enabled together with header login.

What I can confirm from testing:

* Wrong codes now count towards the account lockout on the web login.
* An account disabled while it waits at the challenge page stays disabled
and is not logged in.
* The REST verify step is tied to the API group of the challenge, and the
login history is written only after the second factor.
* Backup codes, replay rejection and the new re-verify step all work.
* With MFA disabled, the REST token endpoint and the normal lockout
recovery behave as before.

A few things still need work before it can be merged. I have put the
details in a comment on the framework PR (
https://github.com/apache/ofbiz-framework/pull/2620#issuecomment-7094327612),
the main ones being:

* With MFA enabled, a timed lockout is never lifted, also for users who
have no factor.
* On REST, each token request resets the failed-login counter, so the
lockout is not reached there.
* One of the new integration tests fails, and the form macro change in the
common theme is still in.

On the SSO limitation you describe (header, JWT, remote user and
certificate logins cannot show the challenge), I confirmed that these
logins fail closed: a user who needs a second factor is simply not logged
in, so there is no way around the factor. I am fine with documenting it for
a first version, since the feature is off by default and a trusted proxy
can be configured. If anyone on the list sees a problem with shipping it
that way, it would be good to hear it now.

Happy to test again once the remaining points are addressed.

Regards,
Mridul Pathak

On Sat, Nov 21, 2026 at 4:39 PM Krishna Uprit <
[email protected]> wrote:

> Hi Mridul,
>
> Thanks for the detailed review and for testing this locally — really
> helpful. I've addressed everything below on both PRs; commit-level detail
> and the full channel-by-channel behavior matrix are in the linked document.
>
>
> *  Testing findings:*  - Failed second-factor attempts now increment
> successiveFailedLogins too (not just the per-challenge counter), on both
> the web and REST paths, disabling the
>     account at the same threshold a wrong password would.
>   - An account disabled while the user is waiting at the challenge screen
> now fails at completion instead of being logged in and silently re-enabled
> — both
>     the challenge-verification step and markSuccessfulLogin itself re-check
> the enabled flag before finishing the login.
>   - The REST challenge's own sessionBindingHash now decides which API group
> a token is minted for; a mismatched group path is rejected, and the group's
>     configured base permission is checked before issuing it.
>   - Basic Auth no longer runs the committing userLogin service up front —
> it defers to the non-committing userLoginMfaPending, and only commits
>     (UserLoginHistory, lockout reset) once the second factor is actually
> satisfied.
>   - Added a reverifyAuthFactor endpoint: a gated action whose proof has
> gone stale now stashes what the user submitted and replays it automatically
> once they
>     re-verify, instead of just failing.
>   - Header/JWT/remote-user/certificate logins: It's a RequestHandler
> preprocessor-chain constraint— these paths can't
>     currently surface a challenge view even when the primary auth succeeds
> — and fixing it properly looked like it needed a core framework change, not
> an
>     MFA-scoped one. I've documented it as a known limitation for now rather
> than ship a partial workaround.
>
>
> *  Design points:*  - Added single-use backup recovery codes (ULAF_BACKUP)
> on both the web and storefront, and stopped blocking forgot-password email
> recovery for MFA accounts
>     — it never bypassed the second factor to begin with.
>   - Added the channel-by-channel doc as being asked for (sy-MFA.adoc),
> covering every entry point and how each behaves under MFA, including the
> limitation above.
>   - Replaced dev.samstevens.totp with a small, self-contained TOTP/HOTP
> implementation on javax.crypto, verified against all 6 RFC 6238 Appendix B
> test
>     vectors.
>   - Switched the REST token's amr claim from "totp" to the RFC
> 8176-registered "otp"/"fido", and added WebAuthn/passkey slots to the
> factor-type enumeration
>     so neither needs a schema change later.
>
>
> *  Smaller things:*  - Corrected the doc/code mismatches listed: QR code is
> a PNG data URI (not SVG), there's no acr claim or totp.window property
> (it's totpWindowSteps, a
>     clock-drift setting, not a re-auth window), and the re-auth window is
> 300 seconds.
>   - Reverted updatePassword routing, the common-theme password macro, and
> the external login key lifetime back to their pre-MFA state on the
> framework side,
>     and mirrored the updatePassword revert on the storefront, so nothing
> changes for non-MFA deployments.
>   - Externalized the hardcoded UI text on both the framework and
> storefront, and removed Working.md from the repo root — its content is
> already covered more
>     accurately by sy-MFA.adoc.
>
> *Updated Proposal Doc:*
>
> https://docs.google.com/document/d/1v-ckX-nNaUrkK4dbs37LuTDN572hLdmc3wQKeilB7nY/edit?usp=sharing
>
> *PRs:* #2620 (framework)
> <https://github.com/apache/ofbiz-framework/pull/2620>,  #523 (plugins)
> <https://github.com/apache/ofbiz-plugins/pull/523>
>
> Please let me know if anything requires further clarification.
>
>
> Kind Regards,
> Krishna Uprit
> Application Security Engineer
> *HotWax Systems*
> *Enterprise open source experts*
> cell: +91-7999304341 <+91%2079993%2004341> <+91%2079993%2004341>
> http://www.hotwaxsystems.com
>

Reply via email to