Skip to content

Add audit reauthentication as its own event and improve diagnostics - #7929

Open
labkey-bpatel wants to merge 2 commits into
release26.7-SNAPSHOTfrom
26.7_fb_saml_reauth_updates
Open

Add audit reauthentication as its own event and improve diagnostics#7929
labkey-bpatel wants to merge 2 commits into
release26.7-SNAPSHOTfrom
26.7_fb_saml_reauth_updates

Conversation

@labkey-bpatel

@labkey-bpatel labkey-bpatel commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Rationale

Nothing recorded that a reauthentication happened. SSO reauth wrote no audit event at all, and local reauth wrote a "logged in" event, which misstates what happened — no session is created and the user was already signed in. On the failure side, every distinct reauthentication failure produced the same "wrong user reauthenticated" message, with nothing in the server log at all, so an administrator hunts for a user mismatch that usually never happened.

Related Pull Requests

Changes

  • Add a REAUTHENTICATED user audit event and auditReauthSuccess(), recorded from each path that completes a reauthentication. finalizePrimaryAuthentication() takes a reauth flag that suppresses the "logged in" event which previously misstated what happened.
  • Split the single "wrong user reauthenticated" error into three, distinguishing a browser that is no longer signed in, and an identity matching no LabKey user account, from a genuinely different user. setReauthUser() keeps its existing name, void return, and signature.
  • Log a warning when reauthentication fails in a way an administrator can act on, naming the identities involved and the likely cause.
  • Note on activity counting: UserManager.getAuthCount() counts audit events matching "logged in", so suppressing that event means reauthentication no longer inflates it. LastLogin is unchanged by this PR and still updated on reauthentication, so the recentUserCount usage metric and the LastLogin column in the Users grid still count it as recent activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant