Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot retrieve Connected App from sandbox with preauthorized permission set name defined #634

Closed
fitzman49 opened this issue Sep 23, 2020 · 2 comments
Labels
area:auth Authorization Experience owned by another team The Salesforce CLI team does not own this work but will pass on the information to the correct team.

Comments

@fitzman49
Copy link

Summary

Connected Apps with a preauthorized permission set defined are throwing an error when pulled via SFDX CLI. If I remove the preauthorization the metadata will pull down successfully. Also, if I add in the preauthorization by hand to the metadata file in my SFDX project and try to push to another sandbox through SFDX CLI (both source and metadata formats) it will create the connected app fine but will not configure the preauthorization correctly for the permission set.

Steps To Reproduce:

  1. Create a connected app with api, web, and refresh scopes.
  2. Click Manage button
  3. Click Edit Polices button
  4. Change Permitted Users option to "Admin approved users are pre-authorized"
  5. Go back a previous screen and select a permission set to add and save
  6. Define the new Connected App in a package.xml manifest in a SFDX project
  7. Execute a "sfdx force:source:retrieve -x path/to/package.xml" against the sandbox
  8. Observe the error in the CLI.

Expected result

Connected App metadata should be pulled into the SFDX project with proper configuration similar to a Connected App without preauthorized permission set defined.

Actual result

An error message is displayed: Metadata API received improper input. Please ensure file name and capitalization is correct. Load of metadata from db failed for metadata of type:ConnectedApp and file name:MyCustomConnectedApp.. No metadata is pulled into SFDX project.

Additional information

SFDX CLI Version(to find the version of the CLI engine run sfdx --version):
sfdx-cli/7.74.1

SFDX plugin Version(to find the version of the CLI plugin run sfdx plugins --core)
@oclif/plugin-autocomplete 0.2.0
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.9.0 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/analytics 0.22.0
@salesforce/lwc-dev-server 1.0.10 (link)
├─ @oclif/plugin-help 2.2.3 (link)
└─ @oclif/plugin-update 1.3.9 (link)
@salesforce/sfdx-trust 3.4.3 (core)
alias 1.1.1 (core)
analytics 1.12.1 (core)
config 1.1.8 (core)
generator 1.1.3 (core)
salesforcedx 49.10.0 (core)
├─ @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
├─ apex 0.0.9 (core)
├─ custom-metadata 1.0.10 (core)
├─ templates 49.9.1 (core)
└─ salesforce-alm 49.11.0 (core)
sfdx-cli 7.74.1 (core)

OS and version:
Windows 10 win32-x64 node-v10.16.0

@fitzman49 fitzman49 changed the title Cannot pull Connected App from sandbox with preauthorized permission set name defined Cannot retrieve Connected App from sandbox with preauthorized permission set name defined Sep 23, 2020
@clairebianchi clairebianchi added the owned by another team The Salesforce CLI team does not own this work but will pass on the information to the correct team. label Dec 1, 2020
@dinhphieu
Copy link

3 years later, I'm still experiencing the same problem that @fitzman49 described

Has this been looked into or put in the backlog?

@preddivari preddivari added the area:auth Authorization Experience label Sep 22, 2023
@mshanemc
Copy link
Contributor

mshanemc commented Oct 6, 2023

@dinhphieu I created a ConnectedApp in a scratch org by following the steps in this issue.

This retrieved just fine
sf project retrieve start -m ConnectedApp:Repro

Then I ran sf project generate manifest --metadata ConnectedApp:Repro to create

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>Repro</members>
        <name>ConnectedApp</name>
    </types>
    <version>58.0</version>
</Package>

which works fine with sf project retrieve start --manifest package.xml

I'm going to close this issue as not reproducible, given the current repro. If you've got a way to cause it on a current CLI, please open a new issue that includes all the details including your repro.

@mshanemc mshanemc closed this as completed Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:auth Authorization Experience owned by another team The Salesforce CLI team does not own this work but will pass on the information to the correct team.
Projects
None yet
Development

No branches or pull requests

5 participants