Loading

Error encountered"We couldn't save the external client app Gateway. [Consumer Secret has to be at least 32 bytes.]" while editing the consumer details of an External Client App migrated from a Connected App.

Udgivelsesdato: Jul 2, 2026
Beskrivelse

After migrating a Connected App to an External Client App (ECA), the user was unable to save changes to the External Client App. Salesforce returned an error indicating that the Consumer Secret must be at least 32 bytes. The user was attempting to add an Apex Plugin Class to the External Client App, but the update could not be saved because the migrated Connected App had created the External Client App with a Consumer Secret that was shorter than the required 32-byte minimum.

Løsning

Suggested Workaround

  1. In your Sandbox org, enable the Allow access to External Client App consumer secrets via Metadata API setting before attempting to update the consumer secret of the migrated External Client App.

  2. Retrieve the External Client App metadata in VS Code using a package.xml that includes the following metadata types:

    • ExternalClientApplication

    • ExtlClntAppOauthSettings

    • ExtlClntAppGlobalOauthSettings

    • ExtlClntAppOauthConfigurablePolicies

    • ExtlClntAppConfigurablePolicies

    • Sample of package.xml

      <?xml version="1.0" encoding="UTF-8"?>

      <Package xmlns="http://soap.sforce.com/2006/04/metadata">

          <types>

              <members>ecaViaMetadata</members>

              <name>ExternalClientApplication</name>

          </types>

          <types>

              <members>*</members>

              <name>ExtlClntAppOauthSettings</name>

          </types>

          <types>

              <members>*</members>

              <name>ExtlClntAppGlobalOauthSettings</name>

          </types>

          <types>

              <members>*</members>

              <name>ExtlClntAppOauthConfigurablePolicies</name>

          </types>

          <types>

              <members>*</members>

              <name>ExtlClntAppConfigurablePolicies</name>

          </types>

          <version>60.0</version>

      </Package>

  3. In the ExtlClntAppGlobalOauthSettings metadata, update the Consumer Secret to a value longer than 32 bytes and set the shouldRotateConsumerSecret tag to true.

  4. Deploy the updated metadata using the following command:

sf project deploy start --metadata ExtlClntAppGlobalOauthSettings --target-org <target-org> --ignore-warnings
  1. After the deployment completes, verify that the Consumer Secret has been updated successfully. Then, try adding the Apex plugin to the External Client App again.

If the workaround is successful in the Sandbox, you can repeat the same steps in your Production org.

Vidensartikelnummer

005388151

 
Indlæser
Salesforce Help | Article