3

I have created a custom Auth Provider and a named credential. I then deployed it to my org as a system administrator. When I tried adding the named credential to User -> Authentication Settings for External Systems, I received an Insufficient Privileges error below:

Insufficient Privileges

You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary. For more information, see Insufficient Privileges Errors.

Here is my auth provider config:

<AuthProvider xmlns="http://soap.sforce.com/2006/04/metadata">
    <executionUser>[email protected]</executionUser>
    <friendlyName>MyCloudOAuthProvider</friendlyName>
    <plugin>MyCloudOAuthProvider</plugin>
    <customMetadataTypeRecord>AuthMeta__mdt</customMetadataTypeRecord>
    <includeOrgIdInIdentifier>false</includeOrgIdInIdentifier>
    <providerType>Custom</providerType>
    <sendAccessTokenInHeader>false</sendAccessTokenInHeader>
    <sendClientCredentialsInHeader>false</sendClientCredentialsInHeader>
</AuthProvider>

AuthMeta__mdt has my key, secret, authorize URL and token URL configured.

All configs are added to the package.xml. The classes and permissions are added to the admin profile.

When I delete the Auth.Provider and recreate it manually in Setup -> Auth.Provider, it works.

Am I missing something for the migration tool deploy?

2
  • Are you using the same user for deployment and configuration?
    – vladykx
    Jul 4, 2016 at 17:29
  • Yes, the same user as the org admin.
    – Keye Liu
    Jul 5, 2016 at 12:29

1 Answer 1

1

The issue is the migration tool looking for the 15-digit ID of customMetadataTypeRecord instead of its name, such as:

<customMetadataTypeRecord>m01340000004ay8</customMetadataTypeRecord>

This doesn't work when you deploy the package to a different org as customMetadataType hasn't been created and the ID is unknown during the deployment.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .