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 -g
To verify the installation run:
dotnet tool list -g
There 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.json
file with configurations
salesforce get-tokens --section:Salesforce
Note: 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:debug
b.) From any location
Or specify url within the dotnet cli tool like so:
salesforce get-tokens --azure https://{name}.vault.azure.net/"
--key
or-k
(SalesforceConsumer Key
)--secret
or-s
(SalesforceConsumer Secret
)--login
or-l
(Salesforce login url)--azure
or-a
(Azure Vault Url)--azureprefix
orax
(Use Environment prefix for Azure vault)--configfile
or-c
(Specify configuration file)--verbose:debug
or--verbose:information
or--verbose:trave
--usesecrets
orus
(Usually a Guid Id of the project that contains the secret)--environment
or-e
(Production, Development, Stage)--section
or-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