We have created one connected app in our managed package, Seems that the managed package always refers to the settings from Source Org for Connected app, and there is no privilege to change it dynamically from subscriber org. We want it to allow to change the Callback URL from Subscribers org as it will differ for each subscriber org.

How can we achieve this? Is there any workaround here?


1 Answer 1


While it is not possible to have dynamic callback URL in one single Conntected App, there are at least three different approaches how to tackle this problem.

  1. Create a public site in your LMO or DevHub and use redirection to LMO public site with state parameter to specify the exact destination to redirect further (similar approach to Eric answer to another question).
  2. Use dynamic app registration to dynamically create a connected app for particular customer, assuming the limit on the number of connected apps created per org is X and you anticipate having Z customers then you should create at least Y = [Z/X]+1 connected apps in different orgs to get initial access token and then use this pool of initial access tokens to dynamically register connected apps with a callback url for each subscriber org.
  3. Use Metadata API to dynamically create a Connected App in the subscriber org and pass the desired Callback parameter there during creation, you can use MetadataService or other implementation or proxy for Metadata API.
  • +1 We ended up using third-party middleware to handle it. But the first option you suggested is a good solution to this problem. Sep 20, 2022 at 14:20
  • by saying third-party middleware you mean that you have some callback URL to your middleware which redirects to the correct org?
    – Patlatus
    Sep 20, 2022 at 15:05
  • probably you could either accept of the provided answers to publish your own answer and accept it if you don't want to accept any of the provided answers
    – Patlatus
    Sep 20, 2022 at 15:06
  • yes, the middleware redirects to the correct org. Sep 22, 2022 at 9:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .