Graph API fails to work on Teams in SPFx webpart
Just to give you a background, i was working on the SPFx webpart which needs to be available on Teams tab. I was fetching values through Graph API.
Though the webpart working well on the SharePoint, but fail to load on the teams. I stumbled to this Git hub discussion, https://github.com/SharePoint/sp-dev-docs/issues/2521
and there was configuration setting suggested in this comment (https://github.com/SharePoint/sp-dev-docs/issues/2521#issuecomment-487962439)
- Before starting following steps, user needs to be Global tenant admin
- Go the the office admin section, click on admin.
- This will take you Microsoft 365 admin center, click on Azure Active Directory.
- On the Azure Active Directory admin center, click on Azure Active Directory–>App Registration
- Or you can go directly through this url
- Under the all Application tab, find “SharePoint Online Client Extensibility Web Application Principal”, click on the application.
- Click on Manifest, Before making any changes take the copy of Manifest json
- Now replace the following json with PreAuthorizedApplication (if there is no value associated),
Hopefully this will resolve the issue.