I'm developing a new managed package that will include a connected app. I created a connected app in a scratch org and committed it to version control. Then, when pushing the source to a new scratch org, I encountered the following error:
The consumer key is already taken.
I assume that this is because every time a connected app's source file is pushed to a new org, a new connected app is created and they obviously cannot share a consumer key.
My question is; in which org should I create the connected app if it needs to be used in all the scratch orgs that are used for development? Do I need to create an unmanaged package in a traditional development org and install it in each new scratch org after pushing the rest of the project's source?
I could create a new connected app in each scratch org but this wouldn't be viable for testing because the web server calling out to Salesforce would need to know the app credentials beforehand-- it couldn't reference multiple new credentials for each new connected app.