Sub topic 3
Restricting Where and How a Salesforce Integration User Can Log In
Assume you understand Salesforce users, profiles, permission sets, SOQL, and OAuth 2.0. The goal is to limit both the places and the methods that an integration user can use to connect.
Restricting login sources and sessions
Set login IP ranges on the user’s profile to the integration server’s fixed public addresses. Requests from other addresses fail before OAuth access is granted. Use a connected app or external client app to control OAuth policies, such as approved users, permitted scopes, and session duration.
For a server-to-server integration, prefer a certificate-based JWT flow when possible. Store the private key outside source control. Disable interactive methods that the integration does not need, such as unnecessary password or browser access.
SELECT LoginTime, SourceIp, LoginType, Status, Application
FROM LoginHistory
WHERE UserId = '005XXXXXXXXXXXXXXX'
ORDER BY LoginTime DESC
LIMIT 20Verifying what the user can do
Test with the same OAuth user and client used in production. Confirm allowed operations, then test denied objects, fields, and record types. Review permission-set assignments and object permissions for unexpected Delete, View All Records, or Modify All Records access.
Common over-privilege mistakes
- Assigning the System Administrator profile for convenience.
- Granting
View All DataorModify All Data. - Giving access to every field when the integration needs only a few.
- Assuming API access bypasses sharing rules.
- Leaving old permission sets assigned after a change in requirements.
Monitoring and auditing activity
Review Login History for unexpected IP addresses, applications, failures, or interactive logins. Use Setup Audit Trail and, when licensed, Event Monitoring to investigate API activity. Alert on unusual volume, new OAuth clients, and permission changes.
Rotating credentials and reviewing access
Rotate JWT certificates, client secrets, and refresh tokens according to your security policy. Revoke old credentials after confirming the replacement works. Review the integration’s requirements, assignments, IP ranges, OAuth scopes, and recent activity on a regular schedule and whenever the integration changes.
Exercise
Which test best confirms that sharing rules still limit the integration user?
Show answer
Authenticate as that user, query a record it should access, then query a record outside its sharing access and confirm the second request is denied.