Creating Auth Providers and Named Credentials for an installed Managed Package is not a simple process. Most Subscriber Admins are overwhelmed by the settings. For that reason, many AppExchange packages automated the creation of those artifacts using APIs.
Recently the Security Review rules were changed, and such automation is not possible anymore. I am now thinking about how to simplify the process for the Subscriber Admin. The main idea is to package partially configured Named Creds and Auth Providers in the Managed Package and have the Admin only complete them with a Client Id and Secret.
- Admin installs the app from Appexchange. It contains a preconfigured Named Credential and Auth Provider.
- Admin registers Salesforce Org on External Service and receives Client Id/Secret
- Admin adds Client Id and Secret to Named Cred and Auth Provider.
- Admin authorized using OAuth flow.
- Our app can connect to the API using the Named Credential
I also know that there is a new type of Named Credentials available.
NOTE: I know this overlaps with Is it posibble to edit Named Credential url in a managed package?, but this answer does not cover the OAuth part from AuthProvider.