How can I setup Salesforce JWT OAuth2Account? Do I need to have access to the machine SnapLogic is running on, and if so, can this be done for a cloudplex?
I'll look this up for you. Setting Up a Salesforce JWT OAuth2 Account The JWT OAuth2 flow is a server-to-server authentication method โ it eliminates interactive logins, which is ideal for backend integrations. Here's how to configure it: Prerequisites - A generated private key and certificate - Valid Issuer (Client ID), Subject (Username), and Audience (Server URL) Step-by-Step Setup Step 1: Generate the private key and certificate
bash
openssl req -newkey rsa:2048 -new -nodes -keyout key.pem -out csr.pem
openssl x509 -req -days 365 -in csr.pem -signkey key.pem -out server.crt
Step 2: Create a Connected App in Salesforce 1. Upload the certificate to the Connected App. 2. Click Manage on the newly created Connected App. 3. Under OAuth policies, set Permitted Users to All users may self-authorize. 4. Go to Manage Apps > Manage Profiles, select System administrator, and save. 5. This generates the Consumer Key and Consumer Secret โ store these securely, as you'll need them for the account. Step 3: Create a .jks keystore file from the same certificate:
bash
openssl pkcs12 -export -in server.crt -inkey key.pem -out keystore.p12 -name myalias
keytool -importkeystore -deststorepass changeit -destkeypass changeit \
-destkeystore keystore.jks -srckeystore keystore.p12 \
-srcstoretype PKCS12 -srcstorepass user -alias myalias
Step 4: Configure the account in SnapLogic Designer | Field | What to Enter | |---|---| | Instance URL | Your Salesforce instance, e.g. https://na123.salesforce.com | | Issuer (Client ID) | The Consumer Key from your Connected App | | Subject (Username) | The Salesforce account username | | Audience (Server URL) | https://login.salesforce.com (production), https://test.salesforce.com (sandbox), or your custom domain | | Keystore | Upload the keystore.jks file (can come from SLDB or an unauthenticated https:// endpoint) | | Keystore password | Password for the keystore | | Key alias | The alias used when generating the keystore | | Private key passphrase | Only needed if it differs from the keystore password | Click Validate to confirm the account works. --- Do You Need Access to the Machine SnapLogic Runs On? No, not necessarily. The Keystore field explicitly supports uploading the .jks file from SLDB (SnapLogic's internal storage) or from any unauthenticated https:// endpoint. This means you don't need direct filesystem/machine access โ you can host the keystore file somewhere accessible over HTTPS, or upload it directly into SLDB through the Designer/Manager, and reference it from there. Does This Work on a Cloudplex? Yes โ since the keystore can be delivered via SLDB or an HTTPS endpoint rather than a local file path, this approach is fully compatible with a Cloudplex, where you don't have direct access to the underlying Snaplex nodes. You simply upload the keystore through the account configuration UI (using the Upload capability), and the account setup process works the same way as it would with any other plex type. --- Related setup: If you haven't yet created the Connected App structure itself in Salesforce (separate from the JWT-specific steps above), you may also want to review the general Salesforce Connected App configuration for OAuth2 accounts, which covers Callback URLs and scopes in more detail. Let me know if you'd like help troubleshooting a specific validation error or want guidance on referencing this account inside a Salesforce Snap pipeline.
