Background: I am making a managed package and have a connected app that needs to have permitted users set to "Admin approved users are pre-authorized" for it to work correctly:
It is a terrible experience for admins installing my app to make them change this value (and this is typically the step that they get wrong). Does anyone know of a way to change this value programmatically...like in a post-install script? It would make it much better for the users.
What I have tried so far:
I tried changing the xml via instructions on https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_connectedapp.htm by adding <isAdminApproved>true</isAdminApproved>
to the <oauthConfig>
part of the .xml for my connected app, but the behavior of scratch orgs created that way was unchanged.
oauthConfig
andoauthPolicy
. Not sure if it's editable in production but worth exploring