TL;DR: Applications can create Salesforce Lead records on behalf of users without building OAuth plumbing, token storage, or refresh logic, while still relying on per-user access tokens and org-specific instance URLs, according to WorkOS. The governance issue is not convenience but the delegation model: who owns the credential, who can revoke it, and how the access path is reviewed.
At a glance
What this is: This is a tutorial on creating Salesforce Lead records from an app through WorkOS Pipes, with the key takeaway that OAuth handling is abstracted while per-user delegated access and token refresh still matter.
Why it matters: It matters because IAM, IGA, and PAM teams still have to govern delegated third-party access, token lifecycle, and revocation even when the application developer does not implement OAuth directly.
👉 Read WorkOS's tutorial on creating Salesforce leads without OAuth plumbing
Context
Salesforce lead creation through delegated access looks simple at the API layer, but the identity problem sits underneath it: the application is acting on a user's behalf across a third-party org boundary. That means the real control questions are about token custody, scope, revocation, and how per-user access is isolated when many tenants connect their own Salesforce environments.
WorkOS Pipes removes the need to build OAuth plumbing, but it does not remove the governance obligations that come with delegated NHI access. For identity teams, this is a familiar pattern: convenience moves the implementation burden, while accountability for access, lifecycle, and auditability stays with the programme owner.
Key questions
Q: How should security teams govern delegated Salesforce writes from applications?
A: Treat delegated Salesforce writes as governed non-human identity activity. Assign ownership, scope the integration to the minimum required Salesforce permissions, and make revocation visible to security and application teams. The important control is not the UI widget itself but the lifecycle around connection, token use, disconnect, and auditability.
Q: What breaks when an app relies on refreshable third-party tokens without lifecycle controls?
A: The main failure is that access continues to exist outside the normal review cycle, even when users disconnect, orgs change, or tokens are revoked. That creates hidden delegated access paths and weakens accountability. Without lifecycle control, teams can no longer prove who can still act on behalf of whom.
Q: How do organisations know if delegated NHI access is still within its intended boundary?
A: Look for clear tenant binding, successful token refresh boundaries, and visible disconnect events. If backend services can request and use access without a correlated identity state, the integration is already outside a defensible control boundary. The signal should be traceable delegated action, not just a successful API call.
Q: Who is accountable when a connected Salesforce org is revoked or misused?
A: Accountability should sit with the application owner and the identity governance team together. The application owner controls implementation and monitoring, while governance owns lifecycle policy, approval, and review. If either side assumes the other is responsible, delegated access can persist without clear ownership.
Technical breakdown
Delegated Salesforce writes and per-user access tokens
The integration pattern uses a per-user access token to let an application call Salesforce on behalf of a connected user. The key technical detail is that each org is multi-instance, so the token response includes an instanceUrl that tells the app where to send the REST API call. This matters because the app is not using one shared integration identity; it is operating under a user-scoped delegated credential with org-specific routing and token refresh handled by the intermediary.
Practical implication: treat the delegated token as a governed identity artefact, not just a transport mechanism.
OAuth abstraction does not remove credential lifecycle risk
The article describes a model where the intermediary handles OAuth code exchange, token storage, and refresh logic. That reduces engineering effort, but the lifecycle problem remains: credentials can expire, be revoked, or become invalid when the connected org changes. In practice, the application still depends on a valid delegation relationship and must handle the absence of a usable token without breaking downstream workflows or silently creating governance blind spots.
Practical implication: build explicit failure handling for revoked or disconnected access instead of assuming token availability.
Widget-based connection flows and access boundaries
The Pipes widget provides the user interface for connecting, disconnecting, and reauthorising third-party accounts. That makes the connection experience easier to embed, but it also centralises a control surface for consent and re-consent. The important architecture point is that the widget is only one part of the access chain. The backend still requests a token, checks whether the integration exists, and then uses that credential to perform the write action, so both frontend consent and backend enforcement matter.
Practical implication: align the widget flow, backend token request, and audit logging so connection state is visible to governance teams.
Breaches seen in the wild
- Salesloft OAuth token breach — hackers stole OAuth tokens to access Salesforce data via Salesloft.
- Shai Hulud npm malware campaign — Shai Hulud campaign: npm malware exposed secrets on GitHub.
Read our 52 NHI Breaches Analysis report for a comprehensive view of breaches impacting Non-Human Identities including AI Agents.
NHI Mgmt Group analysis
Delegated Salesforce writes are still a non-human identity governance problem. The article removes OAuth implementation effort, but it does not change the underlying identity model. The app is still consuming a delegated credential to act in a third-party org, which places the activity squarely inside NHI governance. The programme question is no longer whether engineering can build the flow, but whether the delegated access is scoped, revocable, and attributable enough for audit and lifecycle control.
Access review cadence was designed for persistent entitlements, not ephemeral delegated tokens. The control assumption is that access exists as a stable artefact long enough to be reviewed and certified. That assumption fails when the operational reality is a short-lived, refreshable token managed outside the application’s own credential store. The implication is that entitlement review and token governance are not interchangeable, even when the user experience makes them look similar.
Instance-specific API routing creates identity blast radius if org context is not bound correctly. Salesforce does not behave like a single fixed endpoint, and the token response carries the instanceUrl needed for the right org. If that routing context is mishandled, the access path can drift away from the intended tenant boundary. Practitioners should treat org binding as part of the access model, not just a technical convenience.
Third-party account connection should be governed as a lifecycle event, not a one-time integration choice. Connection, reauthorization, revocation, and disconnect are all governance states, not just UI states. If security and IGA teams do not own those transitions, the application team ends up carrying identity accountability by accident. The practical lesson is that delegated SaaS writes need lifecycle ownership from day one.
From our research:
- 1 in 4 organisations are already investing in dedicated NHI security capabilities, with an additional 60% planning to do so within the next twelve months, according to The State of Non-Human Identity Security.
- Only 1.5 out of 10 organisations are highly confident in their ability to secure NHIs, compared to nearly 1 in 4 for securing human identities.
- If you are building delegated access controls, the Ultimate Guide to NHIs helps separate token handling from lifecycle governance.
What this signals
Delegated SaaS writes will keep expanding the NHI surface area. As more application workflows write into Salesforce, Slack, GitHub, and similar tools on behalf of users, the governance challenge shifts from API integration to entitlement lifecycle management. Teams should expect more shadow delegation unless connection states and token use are logged in a way that security can actually review.
Ephemeral credentials do not eliminate accountability debt. Short-lived access can reduce exposure, but it also makes review harder if organisations do not retain the right metadata about who connected what, when, and for which org. That is why lifecycle evidence matters as much as token validity.
The practical programme signal is that identity teams need a shared control model for application owners, IGA, and security operations. When third-party access is being exercised continuously through delegated tokens, the review surface must include connection state, revocation, and tenant binding, not only application authentication.
For practitioners
- Classify delegated Salesforce access as an NHI workload Assign the integration an owner, scope, and review path that reflects its ability to write records into external orgs on behalf of users. Do not leave it inside generic application inventory only.
- Separate connection state from application login state Track whether the Salesforce org is connected, disconnected, revoked, or awaiting reauthorisation. That state should feed support, audit, and access review workflows instead of living only in the frontend widget.
- Bind token use to the correct tenant context Persist and validate the Salesforce org context and instanceUrl for every write action so backend requests cannot drift across tenant boundaries or hit the wrong environment.
- Instrument revocation and reconnect handling Alert when accessToken retrieval fails, when a user disconnects an org, or when token refresh no longer succeeds. Those events are governance signals, not just application errors.
Key takeaways
- The core risk is not the Salesforce API call itself but the delegated identity model behind it.
- The scale of the issue is that many organisations are still investing in NHI security while confidence remains low.
- Teams should govern connection state, tenant binding, and revocation as first-class identity controls.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST CSF 2.0 and NIST Zero Trust (SP 800-207) set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-03 | Token storage, refresh, and revocation are central to this delegated access pattern. |
| NIST CSF 2.0 | PR.AC-4 | Least-privilege access and boundary enforcement apply to delegated Salesforce writes. |
| NIST Zero Trust (SP 800-207) | Org binding and continuous verification matter when external APIs are invoked on behalf of users. |
Limit delegated access to the minimum org and permission scope needed for the workflow.
Key terms
- Delegated access token: A delegated access token is a credential that lets one system act on behalf of a user in another system. In identity governance terms, it creates a controlled trust relationship that must be scoped, monitored, and revoked like any other non-human identity artifact.
- Instance url: An instance URL is the environment-specific endpoint a service must call to reach the correct tenant or org. For multi-instance platforms, it is part of the access boundary because routing to the wrong instance can break isolation, logging, and authorisation assumptions.
- Connection state: Connection state is the lifecycle status of an external account link, such as connected, disconnected, revoked, or awaiting reauthorization. It matters because governance depends on knowing whether delegated access is currently usable, expired, or no longer authorised.
Deepen your knowledge
Salesforce delegated access and non-human identity governance are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are formalising lifecycle controls for third-party writes into SaaS platforms, it is worth exploring.
This post draws on content published by WorkOS: Create Salesforce leads from your app without building OAuth. Read the original.
Published by the NHIMG editorial team on 2026-03-09.
NHI Mgmt Group — the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org