Mannheim.Salesforce 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Mannheim.Salesforce --version 1.0.0
NuGet\Install-Package Mannheim.Salesforce -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Mannheim.Salesforce" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Mannheim.Salesforce --version 1.0.0
#r "nuget: Mannheim.Salesforce, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Mannheim.Salesforce as a Cake Addin
#addin nuget:?package=Mannheim.Salesforce&version=1.0.0

// Install Mannheim.Salesforce as a Cake Tool
#tool nuget:?package=Mannheim.Salesforce&version=1.0.0

Mannheim.Salesforce

Utilities for accessing Salesforce in non-interactive scenarios.

A part of the Mannheim libraries.

RexisClientProvider

Creates clients using refresh tokens in an in-built token store. This allows accessing Salesforce either non-interactively or with a technical account.

  1. Configure service

services.Configure<SalesforceConfigDataProtectedFileStoreOptions>(o =>
{
    o.Folder = new DirectoryInfo("<<folder path>>");
    o.ProtectorKey = "Key";
});

services.AddDataProtection();
services.AddSingleton<ISalesforceConfigStore, SalesforceConfigDataProtectedFileStore>();
services.AddSingleton<SalesforceClientProvider>();
  1. Provide OAuth configuration
ISalesforceConfigStore store = <<from dependency injection>>;
var config = new SalesforceOAuthConfiguration {
    ConsumerId = "<<from Salesforce>>"
    , ConsumerSecret = "<<from Salesforce>>"
    , RedirectUrl = "<<from Salesforce>>"
};

await store.SaveSalesforceOAuthConfigurationAsync(config);

This needs to be done just once. Later on the config will be stored permanently in the store.

  1. Get OAuth web flow url
SalesforceClientProvider clientProvider = <<from dependency injection>>;
var salesforceLoginUrl = await clientProvider.GetWebFlowUriAsync(new Uri("https://address.my.salesforce.com"));

Alternatively use Device Flow.

  1. Complete web flow and client
SalesforceClientProvider clientProvider = <<from dependency injection>>;
string code = "<<from redirect>>";

await clientProvider.AddClientForTokenAsync(new Uri("https://address.my.salesforce.com"), code);
  1. Use client where needed
SalesforceClientProvider clientProvider = <<from dependency injection>>;
SalesforceClient client = await clientProvider.GetClientAsync();
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.2 is compatible.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.1.0 553 10/3/2019
2.0.0 282 10/3/2019
1.0.0 551 3/2/2019