Skip to content

Commit 74d990d

Browse files
committed
Fix failures related to merge.
1 parent 055cea1 commit 74d990d

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

api/src/org/labkey/api/security/AuthenticationManager.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1608,24 +1608,24 @@ private static String getAuthenticationProcessSessionKey(int configurationId)
16081608
// consumed by handleAuthentication after secondary auth completes, so the reauth token can be issued without
16091609
// replacing the existing authenticated session. Survives the round-trip to external 2FA providers (Duo, TOTP),
16101610
// which is essential because their validate actions call handleAuthentication without form context.
1611-
private record ReauthContext(boolean local) {}
1611+
private record ReauthFlow(boolean local) {}
16121612

1613-
private static String getReauthContextSessionKey()
1613+
private static String getReauthFlowSessionKey()
16141614
{
1615-
return AUTHENTICATION_PROCESS_PREFIX + ReauthContext.class.getName();
1615+
return AUTHENTICATION_PROCESS_PREFIX + ReauthFlow.class.getName();
16161616
}
16171617

1618-
public static void setReauthContext(HttpServletRequest request, boolean local)
1618+
public static void setReauthFlow(HttpServletRequest request, boolean local)
16191619
{
1620-
request.getSession(true).setAttribute(getReauthContextSessionKey(), new ReauthContext(local));
1620+
request.getSession(true).setAttribute(getReauthFlowSessionKey(), new ReauthFlow(local));
16211621
}
16221622

16231623
// Used by 2FA validate actions to tell whether the already-logged-in user is mid-reauth, so they don't
16241624
// short-circuit to the home page and skip the reauth-token issuance in handleAuthentication.
16251625
public static boolean isReauthInProgress(HttpServletRequest request)
16261626
{
16271627
HttpSession session = request.getSession(false);
1628-
return session != null && session.getAttribute(getReauthContextSessionKey()) != null;
1628+
return session != null && session.getAttribute(getReauthFlowSessionKey()) != null;
16291629
}
16301630

16311631
// Clear all primary and secondary authentication results
@@ -1756,11 +1756,11 @@ public URLHelper getRedirectURL()
17561756
// Reauth path: primary (and any secondary) auth has completed. Issue the one-time reauth token on the return
17571757
// URL and bail out *before* setAuthenticatedUser runs, so the user's existing session is preserved. The local
17581758
// flag distinguishes local login-page reauth (must match current session user) from CAS IdP reauth (any user).
1759-
ReauthContext reauthContext = (ReauthContext)session.getAttribute(getReauthContextSessionKey());
1760-
if (reauthContext != null)
1759+
ReauthFlow reauthFlow = (ReauthFlow)session.getAttribute(getReauthFlowSessionKey());
1760+
if (reauthFlow != null)
17611761
{
1762-
session.removeAttribute(getReauthContextSessionKey());
1763-
setReauthUser(primaryAuthUser, reauthContext.local() ? SecurityManager.getSessionUser(request) : null, request, null, url);
1762+
session.removeAttribute(getReauthFlowSessionKey());
1763+
setReauthUser(primaryAuthUser, reauthFlow.local() ? SecurityManager.getSessionUser(request) : null, request, null, url);
17641764
return new AuthenticationResult(primaryAuthUser, url);
17651765
}
17661766

core/src/org/labkey/core/login/LoginController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ public Object execute(LoginForm form, BindException errors)
712712
// secondary auth completes. Session-scoped because secondary auth (Duo/TOTP) callbacks re-enter
713713
// handleAuthentication without form context.
714714
if (form.isForceReauth())
715-
AuthenticationManager.setReauthContext(request, form.isLocal());
715+
AuthenticationManager.setReauthFlow(request, form.isLocal());
716716

717717
AuthenticationResult authResult = AuthenticationManager.handleAuthentication(request, getContainer(), !form.isForceReauth());
718718
// getUser will return null if authentication is incomplete as is the case when secondary authentication is required

0 commit comments

Comments
 (0)