Note: Pre-release packages are distributed via feedz.io.
This is a dotnet cli Saleforce Refresh and Access Tokens Generation tool.
If you like or are using this project to learn or start your solution, please give it a star. Thanks!
dotnet tool install salesforce -gTo verify the installation run:
dotnet tool list -gThere are several ways to run this cli tool.
This tool will open web browser and will require you to log in with your credentials to Salesforce portal in order to retrieve the tokens.
- From any location with Consumer Key and Secret provided
# specify the custom login url
salesforce get-tokens --key:{key} --secret:{secret} --login:https://login.salesforce.com --verbose:information
# use default login url
salesforce get-tokens --key:{key} --secret:{secret} --verbose- Running the tool in the directory that contains
appsettings.jsonfile with configurations
salesforce get-tokens --section:SalesforceNote: required configurations are as follows:
"Salesforce": {
"ClientId": "",
"ClientSecret": "",
"LoginUrl": ""
}- Running with Azure Vault
a.) Location with appsettings.json file
"AzureVault": {
"BaseUrl": "https://{name}.vault.azure.net/"
}, salesforce get-tokens --verbose:debugb.) From any location
Or specify url within the dotnet cli tool like so:
salesforce get-tokens --azure https://{name}.vault.azure.net/"--keyor-k(SalesforceConsumer Key)--secretor-s(SalesforceConsumer Secret)--loginor-l(Salesforce login url)--azureor-a(Azure Vault Url)--azureprefixorax(Use Environment prefix for Azure vault)--configfileor-c(Specify configuration file)--verbose:debugor--verbose:informationor--verbose:trave--usesecretsorus(Usually a Guid Id of the project that contains the secret)--environmentor-e(Production, Development, Stage)--sectionor-sn(The root for the tools configuration the default isSalesforce)
# windows
dotnet build -r win-x64 -c Release -p:PackAsTool=false
dotnet publish -r win-x64 -c Release -p:PackAsTool=false -p:PublishSingleFile=true -p:PublishTrimmed=true -p:PublishReadyToRun=true -f netcoreapp3.0 -o ../../packages
# linux
dotnet build -r linux-x64 -c Release -p:PackAsTool=false
dotnet publish -r linux-x64 -c Release -p:PackAsTool=false -p:PublishSingleFile=true -p:PublishTrimmed=true -p:PublishReadyToRun=false -f netcoreapp3.0 -o ../../packages