Salesforce (CRM)
Community-contributed integration
This integration is community-maintained. Reference: ory/integrates/crm/salesforce.
Sync Ory identities to Salesforce as Leads or Contacts via Ory Actions webhooks, calling the Salesforce REST API with OAuth2 service-to-service authentication.
note
This is the CRM-side Salesforce integration. For Salesforce as a sign-in provider, see the Salesforce social sign-in integration — different integration, different audience.
How it works
- User completes registration / profile update in your Ory-powered application.
- Ory fires an Action on
registration.after/settings.after(typically async). - The Action's body Jsonnet calls Salesforce's REST API directly (
POST /services/data/vXX.0/sobjects/Lead/orContact/) using a stored Salesforce OAuth2 access token.
Setup outline
- In Salesforce → Setup → App Manager → New Connected App:
- Enable OAuth Settings with the Client Credentials Flow (server-to-server).
- Add OAuth scopes:
api(basic REST API access). - Note the Consumer Key and Consumer Secret.
- Configure a Salesforce Permission Set that grants the connected app permission to create the chosen object (Lead or Contact); assign it to the integration user.
- Configure an Ory Action on
registration.after(and/orsettings.after) — the body Jsonnet builds the Salesforce payload and theauthblock points at Salesforce's token endpoint for the access token. - Best practice: deploy a small token-broker service that handles OAuth2 token refresh and returns a short-lived bearer token to Ory; pointing Ory directly at the Salesforce token endpoint is possible but operationally fragile.
Notable
- Lead vs Contact — start with Lead; promote to Contact when the user converts (typically via Salesforce-side automation, not Ory).
- Salesforce edition matters — Connected Apps and Permission Sets require Enterprise or higher; Professional edition may not support all API features.
- Per-object API limits apply (Salesforce daily API call limit varies by edition); high-volume signup flows may need batch creation rather than per-event calls.
