Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
To connect to Salesforce using a Time-Base One-Time-Pad (TOTP) Authenticator code, CopyStorm can be configured with:
A TOTP Authenticator App Code.
The username and password for the Salesforce instance.
TOTP authentication can be enabled in CopyStorm by selecting the “One-Time Password Authenticator” credential type:
To configure a TOTP Security Key in Salesforce:
Open the User Details page.
Click on the link to Connect a One-Time Password Authenticator.
Select “I Can’t Scan the QR Code”.
Copy the Key into CopyStorm.
Click on the “Connect” button in Salesforce to complete the connection.
Save the CopyStorm Configuration File.






For developers, a useful way to provide CopyStorm with Salesforce credentials is via a SFDX username or alias. When an SFDX username is provided, CopyStorm calls out to SFDX to create the a Salesforce session token, relying on SFDX to do all of the OAuth dirty work!
Step 1: Change the CopyStorm credential type to SFDX Username or Alias.
Step 2: Enter an SFDX username or alias.
As a final step, optionally test the connection using the Test Salesforce Connection button.
As a best practice, we recommend using an SFDX alias rather than a username in order to support easier reuse when new scratch orgs are created.
CapStorm applications connect to Salesforce using several supported OAuth login types. This section covers the available options:
Each flow offers a different approach to authentication depending on how your Salesforce org is configured.


To connect to Salesforce using the OAUTH CLIENT CREDENTIALS flow, CopyStorm can be configured with:
The OAuth Client ID
The OAuth Client Secret
OAuth Client Credentials can be enabled in Salesforce by following this tutorial.
OAuth Client Credential logins can be enabled in CopyStorm by navigating to the Advanced Parameters dialog on the Main tab:
After selecting the OAuth 2.0 Client Credentials login type, provide the credentials needed to authenticate with Salesforce:
To connect to Salesforce using the , CopyStorm can be configured with:
OAuth Client ID
OAuth Client Secret
Username
Client ID
The unique identifier issued by Salesforce when you register a connected app. Required for all OAuth flows to identify the requesting application.
Client Secret
A confidential key generated by Salesforce for your connected app. Used alongside the Client ID to authenticate the application during OAuth flows.


OAuth Client Credentials can be enabled in Salesforce by following this tutorial.
OAuth Client Credential logins can be enabled in CopyStorm by navigating to the Advanced Parameters dialog on the Main tab:
After selecting the OAuth 2.0 Username-Password login type, provide the credentials needed to authenticate with Salesforce:
Client ID
The unique identifier issued by Salesforce when you register a connected app. Required for all OAuth flows to identify the requesting application.
Client Secret
A confidential key generated by Salesforce for your connected app. Used alongside the Client ID to authenticate the application during OAuth flows.
Username
The Salesforce username (email address) of the user the application will authenticate as. This must match a valid, active user in the connected Salesforce org.
Password
The Salesforce password for the specified user. Note: If your org requires it, append the user’s security token directly to the end of the password, with no spaces.


CopyStorm supports reading Salesforce credentials from a user-supplied Salesforce password manager.
This feature was introduced when a customer had strict rules on password changes for service accounts in Salesforce and did not want to:
Change the saved password in many CopyStorm configuration files.
Provide the password to CopyStorm on the command line due to security rules.
Since this customer used their own company-wide password manager, an extension was added to CopyStorm to allow them to retrieve password information directly from their password manager instead of from CopyStorm configuration files or the command line.
This article describes how to add a new custom password manager to CopyStorm.
The process to add a new Salesforce password manager to CopyStorm is to:
Write a Java class that extends the class com.aslan.sfdc.connect.credentials.AbstractSalesforceUserPasswordCredentials.
Package the new Java class in a jar and place it in the “lib” subdirectory of the CopyStorm installation.
Add a new CredentialsRegistry.xml file to CopyStorm’s config directory to register the new credential manager with CopyStorm.
The Java class needs to extend com.aslan.sfdc.connect.credentials.AbstractSalesforceUserPasswordCredentials, and will need to override/implement the following methods:
In addition to the required methods above, there are several convenience methods which may be used by credential managers:
CopyStorm discovers all available Salesforce Password Managers by looking for a file named “CredentialsRegistry.xml” in the CopyStorm config directory.
The following CredentialsRegistry.xml file will load a new password manager named “Keyring”:
Click Here to view the Java source of Capstorm’s built-in Keepass Salesforce password manager.
String getSecurityToken()
Yes
Returns the security token used when authenticating with Salesforce.
int injectIntoUI(JPanel panel, int startRow)
No
Adds any UI elements needed by the password manager to the CopyStorm UI.
boolean isAvailable()
No
Returns true if the password manager should appear as an option in the UI.
void saveState(Element e, boolean savePasswords)
Yes
Adds XML attributes to the provided Element to save any information needed to restore system state. This information is saved to CopyStorm’s configuration file.
void restoreState(Element e)
Yes
Restore XML state saved via saveState()
String getFingerprint()
Yes
Returns a value used to determine whether or not credentials have changed. This is used to determine whether or not a cached session may be used when connecting with Salesforce.
boolean isComplete()
Yes
Returns true when information provided by the user is enough to attempt a connection to Salesforce.
void clear()
Yes
Clears out any internal state kept by the password manager.
String decrypt(String encryptedText)
Decrypts text encrypted with encrypt(). This method can be used in the restoreState() function to avoid implementing a custom encryption scheme.
void saveXMLAttribute(Element e, String key, String value)
Adds a new attribute to an XML element. This method can be used in the saveState() function to avoid interacting with the Element directly.
String loadXMLAttribute(Element e, String key)
Retrieves an attribute to an XML element This method can be used in the restoreState() function to avoid interacting with the Element directly.
String getUsername()
Yes
Returns the username used when authenticating with Salesforce.
String getPassword()
Yes
void fireCredentialsComplete(boolean complete)
Enables or disables the “Test Salesforce Connection” button.
void addRowToUI(String label, String toltip, JComponent editor, JPanel panel, int row
Adds a new editor to the UI. This method can be used in the injectIntoUI() method to maintain consistent styling with the rest of the CopyStorm UI.
String encrypt(String text)
Returns the password used when authenticating with Salesforce.
Encrypts text. This method can be used in the saveState() function to avoid implementing a custom encryption scheme to support encrypting saved passwords.
<Credentials>
<CredentialType family="Salesforce" name="Keyring"
class="com.mycompany.copystorm.credentials.KeyringSalesforceCredentials"
/>
</Credentials>By default, CopyStorm does not store Salesforce or database passwords. To enable this option, select the “Store Passwords” option when saving a configuration file. When checked, CopyStorm will maintain Salesforce password security by encrypting Salesforce and database passwords in the save file.
CopyStorm includes an extensible system which allows the usage of third-party password managers to store Salesforce passwords. The default password storage locations include:
Directly within the CopyStorm save file (this is the default).
Within a KeePass file named “passwords.kdbx” located in any of:
The user’s home directory.
The CopyStorm installation directory.
A subdirectory of the CopyStorm installation directory named “config”.
Any directory adjacent to the CopyStorm installation directory.
To use your own password manager, please see our tutorial titled .
To enforce Salesforce password security using the KeePass password manager to authenticate with Salesforce, you will need:
A kdbx (KeePass v2.x) formatted password file containing the username and password of the Salesforce user.
For more information on the KeePass password manager, see
The user’s Security Token may be either:
Appended to the user’s password.
After installing Perl with the kpcli dependencies:
Put the passwords.kdbx file in one of the locations referenced above.
Put the kpcli.pl script in one of the locations referenced above (make sure the file is named “kpcli.pl”).
Make sure the script is installed correctly by running the command:
Stored in a text attribute named “Security Token”
A copy of the kpcli.pl Perl script (version 3.2) available here:
The Perl script is used for both Windows and Linux installations — the Windows-formatted exe will not work.
A Perl installation with all dependencies for kpcli installed.
Dependencies can be found at the kpcli homepage (http://kpcli.sourceforge.net/)
If kpcli.pl is installed correctly and the password entry path is correct, it will print the Salesforce credentials.
Restart the CopyStorm UI. Under the “Advanced Parameters” section of the Main tab, a “Credential Type” option of “Keepass” will appear:
Enter the KeePass file password and the path to the Salesforce user’s password entry:
Test the connection by pressing the “Test Salesforce Connection” button.
If the KeePass file password is incorrect, or if the kpcli.pl script is set up incorrectly, an error will appear which looks like:
If the Entry does not appear in the Keepass file, an error will appear which looks like:
perl /path/to/kpcli.pl -kdb /path/to/passwords.kdbx --command "show -f /password/entry"
CopyStorm supports reading Database credentials from a user-supplied Database password manager.
This feature was introduced to eliminate the need to:
Change the saved password in many CopyStorm configuration files.
Provide the password to CopyStorm on the command line due to security rules.
In addition to security benefits, this feature allows you to use your own company-wide password manager.
The process to add a new Database password manager to CopyStorm is to:
Write a Java class that extends the class com.aslan.sfdc.connect.credentials.AbstractJDBCUserPasswordCredentials
Package the new Java class in a jar and place it in the “lib” subdirectory of the CopyStorm installation.
Add a new CredentialsRegistry.xml file to CopyStorm’s config directory to register thenew credential manager with CopyStorm.
The Java class needs to extend com.aslan.sfdc.connect.credentials.AbstractJDBCUserPasswordCredentials, and will need to override/implement the following methods:
In addition to the required methods above, there are several convenience methods which may be used by credential managers:
Click Here to view the Java source of Capstorm’s built-in Keepass Database password manager.




String getUsername()
Yes
Returns the username used when authenticating with the Database.
String getPassword()
Yes
void fireCredentialsComplete(boolean complete)
Enables or disables the “Test Database Connection” button.
void addRowToUI(String label, String toltip, JComponent editor, JPanel panel, int row
Adds a new editor to the UI. This method can be used in the injectIntoUI() method to maintain consistent styling with the rest of the CopyStorm UI.
String encrypt(String text)
Returns the password used when authenticating with the Database.
boolean setRequired(boolean required)
Yes
Update the credentials editor to indicate that the connection type does not require credential information (e.g. when using SQL/Server’s integrated security).
int injectIntoUI(JPanel panel, int startRow)
No
Adds any UI elements needed by the password manager to the CopyStorm UI.
boolean isAvailable()
No
Returns true if the password manager should appear as an option in the UI.
void saveState(Element e, boolean savePasswords)
Yes
Adds XML attributes to the provided Element to save any information needed to restore system state. This information is saved to CopyStorm’s configuration file.
void restoreState(Element e)
Yes
Restore XML state saved via saveState()
String getFingerprint()
Yes
Returns a value used to determine whether or not credentials have changed. This is used to determine whether or not a cached session may be used when connecting with the Database.
boolean isComplete()
Yes
Returns true when information provided by the user is enough to attempt a connection to the Database.
void clear()
Yes
Clears out any internal state kept by the password manager.
Encrypts text. This method can be used in the saveState() function to avoid implementing a custom encryption scheme to support encrypting saved passwords.
String decrypt(String encryptedText)
Decrypts text encrypted with encrypt(). This method can be used in the restoreState() function to avoid implementing a custom encryption scheme.
void saveXMLAttribute(Element e, String key, String value)
Adds a new attribute to an XML element. This method can be used in the saveState() function to avoid interacting with the Element directly.
String loadXMLAttribute(Element e, String key)
Retrieves an attribute to an XML element This method can be used in the restoreState() function to avoid interacting with the Element directly.
This page provides instructions for connecting to Salesforce using certificate-based / JWT authentication.
To connect to Salesforce using JWT authentication it is necessary configure an External Client App with a certificate, and to provide the certificate and OAUTH Client Id to CapStorm.
Create a certificate using CapStorm by selecting the JWT credential type and exporting the certificate file.
To select the JWT credential type:
Click on the Edit button for Advanced Parameters.
Select Oauth 2.0 JWT in the dropdown.
To Save the certificate:
This will create two files:
The certificate and private key are stored in a file CapStorm_JWT.jks in the CapstormConfig folder.
The CapstormConfig folder is a folder next to the application folder.
For example, if CopyStorm is installed in C:\CapStorm\CopyStorm
Then the CapstormConfig folder will be C:\CapStorm\CapstormConfig
Create an External Client App using the PEM file exported in Step 1.
Login to Salesforce and go to Setup. Search for External Client App Manager in the Quick Find box, and click on New External Client App.
Enter app details:
External Client App Name
API Name
Contact Email
Callback URL
Then, click on “Create”.
After creating the External Client App, configure app policies to allow access.
Click on “Edit” for App Policies, and update the policy to enable appropriate users. In this example, a Permission Set is used to grant access to the app:
Under OAuth Policies, change Permitted Users to:
Admin approved users are pre-authorized.
Under Select Profiles and Select Permission Sets:
Select the Permission Set(s) or Profile(s) that should be granted access to the External Client App.
To configure CapStorm, the Oauth Client Id (Consumer key) from the External Client App will be needed.
Go to the Settings tab of the External Client App.
Under OAuth Settings, click on Consumer Key and Secret.
In the Consumer Details page, copy the Consumer Key.
Copy the Consumer Key:
Now, to finish configuring CapStorm:
Copy the Consumer Key value into the OAuth Client Id text box.
Enter the Salesforce User’s username into the Username text box.
The user must be a member of the Permission Set or Profile configured in the OAuth policy.
Enter the Salesforce instance’s host name into the Salesforce Host text box.
To verify the connection, click on the “Test Salesforce Connection” button. If successful, the below window will appear:
The custom certificate checkbox allows users to create and use their own custom java keystore file, separate from the built-in Java JRE keystore. By enabling this checkbox, several new fields will appear in the login form:
The process of configuring OAuth JWT login with a custom certificate is largely similar to the above steps, the main differences being:
OAuth Public and Private keys will need to be generated manually
The Certificate will need to be generated manually from the public and private keys
The certificate will need to be added to a java keystore file or a PKCS12 file
Keystore info (file path, keystore password, key password, and name) must be entered manually into CopyStorm
After manually generating the above keys and files, the rest of the setup is largely similar to the non-custom certificate flow. Create an external client app, upload the certificate to the external client app, configure the external client app, and finally configure CopyStorm.
For more information on generating keys and certificates for use in Salesforce OAuth JWT, see this .
To connect to Salesforce using the OAUTH JWT flow, CopyStorm can be configured with:
The OAUTH Consumer Key and Certificate.
The username and endpoint for the Salesforce instance.
JWT Authentication can be enabled in Salesforce by following this tutorial. The overall process is to:
Create a Connected Application.
Configure Mutual Authentication, including a Digital Signature and appropriate OAuth Scopes.
Update the Connected Application Policies to allow appropriate users to login to Salesforce.
OAUTH logins can be enabled in CopyStorm by going to the Advanced Parameters dialog on the Main tab:
After selecting the Oauth 2.0 JWT login type, provide the credentials needed to authenticate with Salesforce:
The exported PEM file.
NOTE: This field is required, but the value for Callback URL is not used for JWT Apps.
Enter https://localhost/ as the Callback URL.
OAuth Scopes
At a minimum, the following scopes must be selected:
Access the identity URL service (id, profile, email, address, phone).
Manage user data via APIs (api).
Perform requests at any time (refresh_token, offline_access).
Enable OAuth
This checkbox must be checked.
Enable JWT Bearer Flow
This checkbox allows JWT access.
Certificate Upload
Upload the PEM file that was saved in Step 1.
Click on “Create” to create the External Client App.
CapStorm recommends configuring a Permission Set to limit App access.
Click on “Save” to save the App policies.
Sandboxes will have host names like:
mycompany–mysandboxname.sandbox.my.salesforce.com
Production orgs will have host names like:
mycompany.my.salesforce.com
Click on Test Connection to verify.
Yes
Password used to access the Keystore (blank if the Keystore does not have a password).
Key Name
Yes
The name of the private key used to sign JWT requests.
Key Password
Yes
The password used to access the private key.
OAUTH Client Id
Yes
The Salesforce-generated Client Id for the Connected Application.
Username
Yes
The login Id of the CopyStorm Salesforce user.
Custom Certificate
Unchecked
No
Check this box to use a custom-made Java keystore file (.jks). Leaving the box unchecked will cause the application to use the default Java key store.
Token Validity (minutes)
240
Yes
The lifetime of JWT access tokens. If the token expires during the CopyStorm run, CopyStorm will re-authenticate and get a new token.
Keystore
Yes
Path to a JKS or PKCS12 Keystore containing the private key used to sign JWT requests.












Keystore Password
Yes
Password used to access the Keystore (blank if the Keystore does not have a password).
Key Alias
Yes
The name of the private key used to sign JWT requests.
Key Password
Yes
The password used to access the private key.
OAUTH Client Id
Yes
The Salesforce-generated Client Id for the Connected Application.
Username
Yes
The login Id of the CopyStorm Salesforce user.
Token Validity (minutes)
240
Yes
The lifetime of JWT access tokens. If the token expires during the CopyStorm run, CopyStorm will re-authenticate and get a new token.
Keystore
Yes
Path to a JKS or PKCS12 Keystore containing the private key used to sign JWT requests.


Keystore Password