Generating and Managing Plugin Licenses
This guide provides step-by-step instructions for creating a certificate in Salesforce, generating a license using the certificate, extracting the public key, and storing it in the Plugin__mdt record.
1. Create a Certificate in Salesforce
2. Generate a JWT License
String certificateDevName = 'DefaultKey'; // Replace with the Unique Name of your certificate String pluginId = '@cloudpremise/helloWorldPlugin'; // Plugin ID String version = '0.3.x.x'; // Plugin Version String subscriberId = 'example_subscriber'; // Subscriber ID DateTime expiration = DateTime.now().addYears(1); // Expiration date (1 year from now) String audience = 'https://plugin.cloudpremise.com'; // Generate the license key using PluginManager String licenseKey = PluginManager.generatePluginLicense( certificateDevName, audience, pluginId, version, subscriberId, expiration ); System.debug('Generated License Key: ' + licenseKey);
3. Export the Certificate from Salesforce
2. Extract the Public Key Using OpenSSL
3. Store the Public Key in Salesforce
4. Validate the License (namespace developers only)
5. Best Practices
6. Troubleshooting
Last updated