Sample application demonstrating how to perform OAuth 2.0 Web Server Flow with Salesforce
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Controllers
Infrastructure
Models
Properties
Views
.gitignore
Program.cs
README.md
SalesforceOAuth.csproj
Startup.cs
appsettings.json

README.md

Salesforce OAuth2 Web Server Flow Example

This example is to complement a blog post available at (post link coming soon) which outlines how to use the Web Server Flow method of OAuth authentication with Salesforce, .NET Core, and ngrok.

Prerequisites

Installation

Once you have setup your Salesforce Developer account, and defined the 'Connected App', update appsettings.json file with your client-id and client-secret. Note: You should convert this to use user-secrets in development, and environment variables and/or azure key vault in production to ensure security.

Once settings are updated, crun the following commands from your favorite command console. Mine is ConEmu.

dotnet build
dotnet run

Usage

Below is an example diagram from Salesforce that outlines how the flow works. In our demo application, this follow happens inside the SalesforceController.cs and you can start your code navigation from there.

alt text

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT