We are working on an composite AppExchange Application. Which uses connected app to connect to Salesforce from the composite (external) App. As the composite (external) app has different call-back URLs for different Salesforce instance and different Customers, it was not possible to use a single connected app which can reside in a central org (free dev org), and use the same (single) connected app for all subscribers to connect to their SF org. Due to that a manual configuration was added to configure a connected app per customer Salesforce org. Below is the basic representation of the same.
Question: Above process is working fine but it involves some manual efforts on customer orgs (setup connected app) every time when a user installs the App in Sandbox, Production, Trial orgs.
One possible solution will be to use a single connected app in a central org with a call-back URL of a middleware page. And middleware page will handle the redirection to different call-back URLs.
Other than a middleware page to handle multiple call-back URLs, is there any other way through which we can make connected app configuration easy for every new App subscriber?