pnp / sp-dev-fx-webparts

SharePoint Framework web part, Teams tab, personal app, app page samples
http://aka.ms/spfx-webparts
MIT License
2.05k stars 3.86k forks source link

react-birthdays - support for Microsoft Teams home site app #2430

Closed joostvdlinden closed 2 years ago

joostvdlinden commented 2 years ago

Sample

react-birthdays

Author(s)

@smaity @joaojmendes

Question

I have implemented this Birthday web part in February 2020. It works fine on SharePoint Online.

But when add the Communication Site as a Home site app to Teams, it shows all web parts except the React Birthdays web part: 2022-03-12 10_04_14-dx lounge _ Microsoft Teams

Is this unsupported or how could I resolve this issue?

Many thanks!

ghost commented 2 years ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

arturstrzalkowski commented 2 years ago

Any update regarding this issue? We have the same problem here. @hugoabernier

hugoabernier commented 2 years ago

Thank for reaching out. These samples -- and issues related to them -- are community-supported; we rely on the goodwill of those who authored the samples or those willing to spend their free time to help with issues.

From what it seems, you have tagged the authors and provided sufficient information. The authors may be too busy at the moment to help. You might want to tag the authors instead of me.

I have added a Help wanted flag to see if we can encourage others in the community to pitch in.

Best of luck with solving this issue!

mgwojciech commented 2 years ago

Hi @joostvdlinden I tried to reproduce it but works fine in my environment. I took a look in the code and the functionality is based on MSGraphClient, it's possible there are some issues related to authentication. If You can, try to open Teams Desktop in Developers preview and open dev tools (more on it here: https://docs.microsoft.com/en-us/microsoftteams/platform/tabs/how-to/developer-tools) This can give You more insights into the problem. If I'm right about the authentication, I would suggest changing accessTokenAcceptedVersion in SPO Ext Principal. To do that navigate to portal azure, go to AAD and then to App Registrations. Now in All applications find SharePoint Online Client Extensibility Web Application Principal. Go the manifest and set accessTokenAcceptedVersion to 1. Save the manifest. From now on You should be able to authenticate to Graph in Teams client.

Hope that will help.

joostvdlinden commented 2 years ago

Hi @joostvdlinden I tried to reproduce it but works fine in my environment. I took a look in the code and the functionality is based on MSGraphClient, it's possible there are some issues related to authentication. If You can, try to open Teams Desktop in Developers preview and open dev tools (more on it here: https://docs.microsoft.com/en-us/microsoftteams/platform/tabs/how-to/developer-tools) This can give You more insights into the problem. If I'm right about the authentication, I would suggest changing accessTokenAcceptedVersion in SPO Ext Principal. To do that navigate to portal azure, go to AAD and then to App Registrations. Now in All applications find SharePoint Online Client Extensibility Web Application Principal. Go the manifest and set accessTokenAcceptedVersion to 1. Save the manifest. From now on You should be able to authenticate to Graph in Teams client.

Hope that will help.

Hi @mgwojciech thank you for helping out! I have discovered that in Google Chrome web browser the birthday web part actually works when I have opened the home site app through Teams web app, and also in Microsoft Edge Chromium. But not on Microsoft Teams desktop.

I ran the Developer Tools, which was really helpful, and through the console I could see the following error message: "Uncaught (in promise) Unable to retrieve Client Secret". Not sure if this influences your findings?

I will definitely take a look at your suggestions and I'll let you know the outcome.

joostvdlinden commented 2 years ago

Hi @mgwojciech, I have also tried changing the parameter accessTokenAcceptedVersion from null (initial value) to 1. Me and my colleague both fully closed Teams desktop, but it did not help.

mgwojciech commented 2 years ago

So maybe one last thing, which I noticed happens very randomly. Try to consent SPO Ext Principal permissions in AAD. Sometimes it looks like permissions are granted and consented but are not. This usually happens when You used SPO Admin center to grant permissions before.

joostvdlinden commented 2 years ago

So what I did is I generated a whole new sppkg package and followed the implementation steps again. The problem got fixed after applying the API permissions from the SharePoint admin center. The existing web part I had published now works fine. Thanks for the help @mgwojciech