kdcllc / CometD.NetCore.Salesforce

CometD Salesforce Implementation.
MIT License
45 stars 24 forks source link
bay cometd dotnet-cli dotnet-core salesforce salesforce-apex salesforce-api salesforce-developers salesforce-rest-api workbench

CometD.NetCore.Salesforce

GitHub license Build status NuGet Nuget feedz.io

Note: Pre-release packages are distributed via feedz.io.

Summary

This repo contains the CometD .NET Core implementation for Salesforce Platform events.

These events can be subscribed to and listened to by your custom Event Listener. The sample application of this library can be found here.

The solution contains the following:

  1. CometD.NetCore2.Salesforce

  2. DotNet Cli tool salesforce

buymeacoffee

Give a Star! :star:

If you like or are using this project to learn or start your solution, please give it a star. Thanks!

Install

    dotnet add package CometD.NetCore.Salesforce

Saleforce Setup

Watch Video

  1. Sing up for development sandbox with Saleforce: https://developer.salesforce.com/signup.
  2. Create Connected App in Salesforce.
  3. Create a Platform Event.

Create Connected App in Salesforce

  1. Setup -> Quick Find -> manage -> App Manager -> New Connected App.
  2. Basic Info:

info

  1. API (Enable OAuth Settings): settings

  2. Retrieve Consumer Key and Consumer Secret to be used within the Test App

Create a Platform Event

  1. Setup -> Quick Find -> Events -> Platform Events -> New Platform Event:

event

  1. Add Custom Field

event

(note: use sandbox custom domain for the login to workbench in order to install this app within your production)

Use workbench to test the Event workbench

AuthApp

OAuth Refresh Token Flow

Use login instead of test Simple application that provides with Web Server OAuth Authentication Flow to retrieve Access Token and Refresh Token to be used within the application.

Username/Password Flow

To enable Username/Password flow and grant type, simply omit the auth token and refresh token while providing the username, password and user api token.

Special thanks to our contributors

Related projects