Post-Installation Setup (takes ~3–5 minutes)
To enable server-to-server authentication for your application using JWT Bearer Flow, follow these steps to manually create and configure a Connected App with a self-signed certificate.
Step 1 – Assign the Permission Set
- Go to Setup → Permission Sets → Flow Scanner User.
- Click Manage Assignments → add your users → Done.
Step 2 – Create the Connected App
- Go to Setup → App Manager → New Connected App.
- Fill in the basic info:
- Connected App Name:
Flow Scanner JWT
- API Name:
Flow_Scanner_JWT (auto-populates based on the name)
- Contact Email: your email address
- Under API (Enable OAuth Settings):
- Check Enable OAuth Settings
- Callback URL:
https://login.salesforce.com/services/oauth2/success (placeholder; not used in JWT flow but required)
- Check Use digital signatures
- Require Secret for Web Server Flow: Uncheck (if visible)but we
- Require Secret for Refresh Token Flow: Uncheck
- Enable Client Credential Flow: Uncheck
- Enable Authorization Code Flow: Uncheck
- Require PKCE: Uncheck
- Enable Token Exchange Flow: Uncheck
- Selected OAuth Scopes: Add
Access and manage your data (api) and Perform requests on your behalf at any time (refresh_token, offline_access)
- Uncheck other options like Enable Named User JWT Flow, Introspect All Tokens, Refresh Token Rotation, Secret Required for Token Exchange
- Under OAuth Policies:
- IP Relaxation:
Relax IP restrictions
- Refresh Token Policy:
Refresh token is valid until revoked
- Click Save (it may take a few minutes for the app to be created).
Step 3 – Create & Upload the Certificate (45 seconds)
- Go to Setup → Certificate and Key Management.
- Click Create Self-Signed Certificate.
- Fill in:
- Label:
Flow Scanner
- Unique Name:
Flow_Scanner ← must be exactly this
- Key Size: 2048 or higher
- Click Save.
- Download the certificate (
.crt file).
- Go to App Manager → Flow Scanner JWT → Manage → Edit.
- Under Use digital signatures, click Upload Certificate.
- Upload the
.crt file → Save.
- In App Manager → Flow Scanner JWT → View.
- Click Manage Consumer Details (verify identity once).
- Copy the Consumer Key (starts with
3MVG…).
- Open Developer Console (from Setup or the gear icon menu).
- Go to Debug → Open Execute Anonymous Window.
- Copy and paste this script:
```apex
// PASTE YOUR CONSUMER KEY HERE (between the quotes):
String consumerKey = ‘YOUR_CONSUMER_KEY_HERE’;
if (String.isBlank(consumerKey) || consumerKey.contains(‘YOUR_CONSUMER_KEY_HERE’)) {
System.debug(‘ERROR: Please set your Consumer Key first!’);
} else {
Id jobId = lfscanner.LFSSetup.configure(consumerKey);
}
```
- Replace
YOUR_CONSUMER_KEY_HERE with your actual Consumer Key (the one you copied in step 3).
- Click Execute.
- Check the Logs tab at the bottom for the “SUCCESS!” message.
- Wait 10-30 seconds for the deployment to complete.
Note: The Consumer Key is stored securely in protected custom metadata and is not visible in the UI.
Step 5 – Pre-Authorize the Connected App (optional, to avoid consent screen)
- In App Manager → Flow Scanner JWT → Manage → Edit Policies.
- Set Permitted Users to Admin approved users are pre-authorized → Save.
- Scroll to Profiles section → Manage Profiles.
- Check System Administrator (or relevant profiles) → Save.
- This allows users with those profiles to use the app without prompts. If you need more granularity, create a custom (unmanaged) Permission Set and assign it here instead.
The app is now ready to use! Assigned users can run Flow Scanner features, and JWT authentication will handle Tooling API calls seamlessly.