I was using legacy named credential till now and used to package a named credential with no authentication type. I used the same in my packaged apex code. Once the package was installed, the customers were able to change the authentication type to OAuth2.0 with browser flow and use a Auth. provider for which I already have a class extending Auth.AuthProviderPluginClass. Now I am trying to migrate to the new named credential + external credentials, I package a named credential pointing to my packaged external credential which have a no authentication type, but now when the package is installed the customer is unable to edit the external credential nor the named credential.

Getting following error:

Cannot modify managed object: entity=ExternalCredential, component=0pt5g000000PBC3, field=AuthenticationProtocol, state=installed: newValue='O', oldValue='U'

Anyone knows how can I package the named credential and external credential such that it can be edited later on. As I cannot package Auth. Provider so I am unable to create a fixed external credential that does not need to be edited by customer. Also, if I won't be able to edit and save the external credential with OAuth2.0 browser flow type, how would the access token and refresh token of the customer be stored in user external credential to use in a callout?


You must log in to answer this question.