[BUG] Sync-PnPAppToTeams Authentication Method is not allowed #2554
Replies: 11 comments
-
Hii looks like some issue with your installation, this is not a bug. Can you maybe try to uninstall and re-install ? or maybe install it on a different machine. |
Beta Was this translation helpful? Give feedback.
-
I've uninstalled and tried again. Get the same error. Tried on another machine. Get the same error. Colleague gets the same error. |
Beta Was this translation helpful? Give feedback.
-
Hi Dave (@thehorseofcourse), |
Beta Was this translation helpful? Give feedback.
-
What is the exact error that you are facing ? The one in the screenshot is "... is not recognized as a cmdlet , ... etc" . Is a generic error and has nothing to do with PnP PowerShell. Maybe this link can help: |
Beta Was this translation helpful? Give feedback.
-
@gautamdsheth I have been an idiot and copied the wrong screenshot. Very sorry. I have updated with the actual problem. Sorry for the inconvenience. |
Beta Was this translation helpful? Give feedback.
-
@thehorseofcourse / @asadrefai - looks like you are using Weblogin method to authenticate. Would suggest that you change the approach and use a different authentication model for SharePoint via OAuth and an Azure AD application. Weblogin is legacy, insecure and will be removed at some point in future. |
Beta Was this translation helpful? Give feedback.
-
Thanks @gautamdsheth will give it a go |
Beta Was this translation helpful? Give feedback.
-
@gautamdsheth What permissions would be needed on an app reg. To get this working, I've added a few Application for graph and sharepoint Sites.Fullcontrol, TeamsAppInstallation, AppCatalog still getting the same error. Do I need Delegated permissions instead? |
Beta Was this translation helpful? Give feedback.
-
Am moving this to discussion, I usually use delegated permissions and works fine. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
I have the same issue. In my case it doesn't work with It works:
It fails with "Authentication Method is not allowed" exception:
Also it worked before, when I used SharePointPnPPowerShellOnline PowerShell module. I tried to look at source code and the only difference I found is that old AppManager sets cookies if access token is empy and in new version this code is not presented. Old AppManager (https://github.com/pnp/PnP-Sites-Core/blob/deba8844ac45fa3e481ab11c66dfa4cd85489b4d/Core/OfficeDevPnP.Core/ALM/AppManager.cs#L841):
New AppManager doesn't have this code (https://github.com/pnp/pnpframework/blob/ed3d8c5d225694d0548c05b8229b247b4e00ef33/src/lib/PnP.Framework/ALM/AppManager.cs#L803) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Reporting an Issue or Missing Feature
I am reporting a bug
Expected behavior
Using
Sync-PnPAppToTeams
should deploy an App in the SharePoint App catalog to TeamsActual behavior
I am currently trying to deploy an App that is in my SharePoint App catalog to Teams. I first connect to my app catalog with
Connect-PnPOnline
with an account which has global admin, SharePoint Admin and Teams Admin permissions.I then get the following error when running
Sync-PnPAddToTeams
Steps to reproduce behavior
Connect-PnPOnline -Url https://contoso.sharepoint.com/sites/apps
Sync-PnPAppToTeams -Identity "AppID"
OR
Connect-PnPOnline -Url https://contoso.sharepoint.com/sites/apps -ClientId $(SPFxclientId) -CertificatePath $certificatePath -CertificatePassword $SecurePassword -Tenant $tenantName
Sync-PnPAppToTeams -Identity "AppID"
What is the version of the Cmdlet module you are running?
Which operating system/environment are you running PnP PowerShell on?
Beta Was this translation helpful? Give feedback.
All reactions