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">

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?

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

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


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.