Audit During and After Login
Esta página aún no está disponible en tu idioma.
Module 5 of 6 in the chapter Watching the Door: Troubleshooting and Audit, chapter 16 of Securing Salesforce: Identity and Access. Each module stands on its own.
The question this module answers: After the fact, how do you show who logged in, how, and what changed at the door?
A different question
Section titled “A different question”The first four modules asked “why did this login fail?” Audit asks something else. Someone from security, or an auditor, or a manager after an incident, asks: who logged in last Tuesday night? How did they prove it was them? Who’s logged in right now? Who changed the single sign-on setting, and when? Did an admin log in as one of our customers?
These are questions about logins that worked. And the honest answer to several of them depends on two things: what your org records by default, and whether you have the add-on that records more. This module goes through five questions, and for each one, what every org has and what the add-on adds.
Who logged in, and how did they prove it?
Section titled “Who logged in, and how did they prove it?”Module 2 covered the two logs for this: Login History, for every login to the org and its sites, and Identity Verification History, for every time Salesforce asked someone to prove it was them. Both are in every org, both keep 6 months (S1, S2). For “how did they prove it,” the columns that matter are the login type and subtype, the Authentication Method Reference, and in Identity Verification History, the method and what triggered it.
So for most audit questions about the last six months, you already have the answer. The question to settle early is the seventh month. If your policy says a year, Salesforce’s 6 months won’t meet it, and someone has to download and keep the records (S1).
Who is logged in right now?
Section titled “Who is logged in right now?”The Session Management page lists every active session, in every edition, “including those of JWT-based access tokens” (S8). For each one: the user, the Login Type (Application, SAML, Portal), the Session Type (UI, API and others), the source IP, the location, when it started, and when it ends (S8).
And you can act on it. Remove ends a session, and “the user must log in again” (S8). Module 4 noted the timing: for most services, removing the session revokes its access token at once; for some, it can take up to 30 minutes (S8). When an incident starts, this is the page you open first. Chapter 13 added the app’s side: the OAuth Usage page, who’s connected to each app, and revoking an app’s tokens.
Who changed the door?
Section titled “Who changed the door?”Most outages in module 1 start with “since a date,” and most audits want to know who changed what. Both answers are in the Setup Audit Trail: the 20 most recent changes on the page, 180 days in the download; “After 180 days, setup entity records are deleted” (S3).
For identity, it records the changes that open or close a door (S3): certificates added or deleted; My Domain changes; Salesforce enabled or disabled as an identity provider; SAML configuration; identity providers and service providers; single sign-on enabled or disabled for a profile; login hours; password policies and resets; session settings, with two exceptions, the profile session timeout and session security level; Lightning Login; Transaction Security; and “some” connected app and external client app policy changes. Notice the word “some.” If a change to an app’s policy matters to your audit, test whether it shows in the trail before you rely on it.
Two columns are worth knowing. Delegate User shows when the change was made by someone logged in as another user (S3). And a newer one, AI Agent, shows changes made through Setup with Agentforce, a beta as of 2026-11-06 (S3). An agent changing your Setup is still a change to your door, and Salesforce writes it down.
Who logged in as someone else?
Section titled “Who logged in as someone else?”Admins can log in as another user, to see what the user sees. It’s useful, and it’s exactly what an auditor will ask about, especially for customers and partners on a site. The Setup Audit Trail records admins logging in to a site as its users, and the Delegate User column shows what was done while logged in as someone else (S3). With the add-on, LoginAsEvent records “when Salesforce admins log in as another user” (S9).
What the add-on adds
Section titled “What the add-on adds”Everything above is in every org. Shield, or the Event Monitoring add-on on its own, adds a stream of events, and this is where I want to be careful and fair, because it’s easy to oversell or undersell.
What it adds, for logins (S9): LoginEvent, which captures “who was blocked from successfully logging in”; LogoutEvent; IdentityVerificationEvent; IdentityProviderEventStore, for Salesforce as the identity provider; LoginAsEvent; and two that look for patterns rather than single logins: CredentialStuffingEventStore and SessionHijackingEventStore. It also adds event log files: more than 70 types of activity, written as files you download or send to a security tool (S10). And it adds the ability to act on a login, not just record it: transaction security, module 6.
How long each is kept is where Salesforce’s own pages disagree, so here it is as a range, dated. As of 2026-11-06, one page says LoginEvent is kept 6 months (S4), another up to 10 years (S9). One says event log files are kept 30 days by default and up to a year (K3), another a year by default (S13). Check your own org’s settings and your contract; the number that matters is the one you can show.
Without the add-on, Salesforce gives a limited set of event log types, kept for one day, and since Summer ‘23 you opt in with the Generate Event Log Files setting (K3). In a Developer Edition org, you get every event type, kept one day (S9, K3). That’s enough for the practice to show you what they look like, and not enough to audit anything.
So which do you need? The free tools answer “what failed, and who logged in” for six months. The add-on answers “what is happening, as it happens,” keeps more, and can act. Whether that’s worth it depends on what your security team must be able to show, and that’s a decision for them and you together, before the auditor arrives. Sharing and Visibility, chapter 19 (Monitoring: Real-Time Events, Log Files and Transaction Security) goes through it in full (Event Monitoring Is a Fire Hose and Real-Time Events).
Test knowledge. In my experience, know the tools to audit and verify what users do during and after login: Login History and Identity Verification History during; Session Management, the Setup Audit Trail and Login As after. Know what Event Monitoring adds, and that it’s an add-on.
What’s next
Section titled “What’s next”Module 6: transaction security at the door. Not only recording a login, but acting on it: block it, or ask for more proof.
What an architect decides here
Section titled “What an architect decides here”- How long login and setup records must be kept, and who downloads them before Salesforce deletes them.
- Who may end sessions in an incident, and who they tell.
- What counts as a change to the door, and whether the Setup Audit Trail shows it.
- Who may log in as a customer, and how it’s reviewed.
- Whether you need Event Monitoring, decided with the security team, on what they must be able to show.
Beyond the exam: what AI changes. Agents log in and change things too. Setup with Agentforce already shows its changes in the Setup Audit Trail’s AI Agent column (S3), and an agent acting for a user comes through the same doors as everyone else, so it lands in the same logs. Chapter 17 asks the harder question: who was the agent acting for?
Explore
Section titled “Explore”- Monitor Setup Changes with Setup Audit Trail (opens in a new tab) (Salesforce Help; checked 2026-11-21)
- View User Session Information on the Session Management Page (opens in a new tab) (Salesforce Help; checked 2026-11-21)
- Real-Time Event Monitoring Data Storage (opens in a new tab) (Salesforce Help; checked 2026-11-21)
- Salesforce Event Monitoring Frequently Asked Questions (opens in a new tab) (Salesforce knowledge article; checked 2026-11-21)
