I am trying to do a sfdx force:source:pull from a scratch org where I defined and authenticated a Named Credential and Auth Provider (OAuth2 Named Principal). I get:

• RetrieveFailed - Entity of type 'AuthProvider' named 'MyProvider' cannot be found

The only thing that I have found was this Known Issue: Metadata cannot be pulled after first authentication with Lightning for GMail without any workaround.

  • Not sure if you really want to pull the metadata, otherwise you could skip the complaining file by adding them to .forceignore
    – Raul
    Jun 11, 2019 at 13:51
  • How would I do that for this case? Add **AuthProvider or **NamedCredential there? Jun 11, 2019 at 13:58
  • Either that or its complaining about file named A360 Keycloak, you may need to do few tries.. :)
    – Raul
    Jun 11, 2019 at 14:08

2 Answers 2


Make sure your AuthProvider name has no spaces.

I was able to pull the metadata using the retrieve command:

sfdx force:source:retrieve -m AuthProvider

However, your subsequent pull commands will continue to fail because it cannot find the AuthProvider.

If you rename it replacing spaces with underscores (Name and URL Suffix will both have no special chars) pull commands will work just fine.

Hope this helps.



I was able to selectively pull the problematic metadata using this plugin https://www.npmjs.com/package/@rohanatgwcs/sfdx-selective-retrieve-deploy

sfdx gs:source:pull --type AuthProvider --names MyProvider --targetdir force-app/main/default/authProvider
  • 1
    Appear to be getting this issue again. Using API version 53.0. Jan 5, 2022 at 20:56

You must log in to answer this question.

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