ALM API does not automatically trust a SharePoint-hosted app on installing to a site
Category
- [X ] Bug
Expected or Desired Behavior
When installing a SharePoint-hosted Add-In from the app catalog the app should be trusted on the site collection automatically.
Observed Behavior
After installing the SharePoint-hosted Add-In with site collection scoped permissions the app is deployed to the provided site but not trusted. Trust has to be done manually through the SharePoint UI which destroys the whole purpose of fully automating provisioning of apps using ALM API.
Steps to Reproduce
Prerequisites:
- SharePoint-hosted App must be already added to App Catalog (you can use this app for example: skybowRichFormsFullTrust_3.1.18.3.zip )
Using ALM API from PnP Powershell (but can be reproduced in any other way of using SharePoint ALM API):
- Connect to site:
Connect-PnPOnline –Url https://yourtenant.sharepoint.com/sites/yoursite - Find out the app's Id using:
Get-PnpApp - Install app to site:
Install-PnPApp -Identity <AppId>(whereis Id as listed in Get-PnPApp) - Go to SharePoint site in browser, navigate to Site Contents and look for installed/installing app
- Wait until app is fully installed
- Click on the app to open it's main page You'll get the following error "Access denied: You don't have enough permissions or you don't trust this app." is shown.
To manually trust (which shouldn't be necessary): Go to Site Contents and select "Manage permissions" in the "…" menu for the appropriate app, then click the "here" link in the text "If there's something wrong with the app's permissions, click here to trust it again."
Hi @DanyWyss, this has been identified now and we should have it now fixed. We'll test this in following days and hopefully, we can push out the fix to production early January. Really unfortunate one, but we are working on getting it resolved asap.
Hi @VesaJuvonen, great news, can test as soon as the fix is available. Thanks!
Sorry for the delay around this. We had some complications with the fix but should have now things again worked out. We will finalize testing early next week and roll out the fix to production asap based on those results. I'll update and close this issue when things have been verified and 100% rolled out to production.
Fix has been now rolled out to production. We do apology delay around this, but the issue is finally fixed. Issue was related on the add-ins and did not include SPFx solutions. Closing this as root cause has been now fixed.
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues