Expected or Desired Behavior
SPFx Solution with MS Graph works in MS Teams Native Clients.
Observed Behavior
Cannot read property 'match' of undefined
Steps to Reproduce
Create SPFx web part for Teams
add some MS Graph request
Try to run the web part as Teams tab
This Issue is related to issue: #4357
I tried the following instructions and they did not resolve the issue:
Manual Steps
Step 1. Go to -> https://aad.portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview
Step 2. Click on SharePoint Online Client Extensibility Web Application Principal
Step 3. Click Manifest on the left menu
Step 4. Remove all entries in the PasswordCredentials section (Should leave a empty array)
Step 5. Save the manifest
Step 6. Visit the new API Permission Management Page on the Tenant Admin Site. This creates a client secret behind the scenes.
Step 7. Wait 10 minutes
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
Facing the same issue with Microsoft Teams native client and Graph API Calls and it's not resolved by following the steps mentioned in the question too.
SPRequestGuid: 423e1b9f-80c6-9000-3d0b-016798f5355c
Any update on this please?
@juanmlarios Finally found out what the problem was. The fixes that are suggested will work for the webparts that are NOT configured to be hosted in Isolated domain. So according to my understanding 'SharePoint Online Client Extensibility Web Application Principal' serves here and permissions assigned to such webparts/apps are accessible to other (non-isolated) apps in the tenant as well. When webparts are configured to be hosted in an isolated domain, there is a dedicated application created in Azure AD for that webpart and granted permissions are limited to the corresponding webpart(s) only. But problems i.e. Teams Desktop client issue and Teams sdk issue, still persist with such webparts and Microsoft needs to provide solution for that.
And also there is a weird problem that appears when isolated webparts are installed as a tab in Microsoft Teams (at least this is the case with me). Every time the tab reloads, webpart is initialized/reset and property pane gets opened. while this is not the case with non-isolated webparts.
@wobba - We're experiencing same issue. This issue is happening only in environment which has (Multi Factor Authentication) MFA enabled for user accounts and other environments are running when it is disabled.
Not sure whether MFA enabled accounts have an issue in accessing graph client via Teams Desktop.
This is my observation after spending 2 whole days. ;)
This issue still persists. We have followed the advice of @muradhaider5, i.e. configuring the web part to NOT be hosted in an isolated domain, but we are still receiving the same error.
Of note, we have created a demo O365 tenant to test further and found the following:
Any suggestions or updates on this issue?
There are unfortunately known issues around this area on hosting the code at the Teams Desktop. Code changes have been now checked in and we are in progress of getting things out gradually after testing them internally. We do understand that this is not really an optimal situation and this issue should have been properly addressed much faster.
I'll keep this issue up to date on the progress as changes are rolling out.
Thanks @VesaJuvonen ! this is a lifeline as the customer has been waiting for a response for while. I'll keep an eye on the ticket for updates
Thanks @VesaJuvonen. Even our customer was waiting for longtime this to be fixed. Hope to see this issue resolved in a couple of weeks.
Hi @VesaJuvonen this is still an issue for my customer. Let me know if you need any other info to check into this further.
Update:
We found a blocking issue while rolling out the fix. We need to address this issue before moving forward with the rollout. I will return back with an update shortly.
Thank you for you patience.
Thanks for the update @lahuey , I can't believe it's been almost 5 months since the original issue. I am trying to understand how anyone is having success with the Graph API and Teams/SPFX solutions. Is this tenant-specific? is it only a few partners/customers experiencing this issue? would be nice to understand what the issue is exactly. I know my customer would appreciate an explanation. Any info you can share would be great. Thanks!
Is this issue already fixed or is there any update on it?
Currently showing a SharePoint page with an spfx webpart on it on a teams website tab.
The spfx webpart calls the Graph API to get the groups where the currently logged in user is a member of.
This works well for internal users, but not for external users. This is really a blocking issue as we are working with them on a day to day base in Teams.
External users have to use 2 factor authentication by company policy.
If I debug the page in Teams as an external user I also get this message "Cannot read property 'match' of undefined" when calling the Graph API.
@juanmlarios - this should be absolutely addressed from the SPFx perspective, but it also depends on which API you call, as an example - in the case of @MistahG's question, issue is really on the Graph API side which apparently does not support this call for external users.
We cannot provide support for Graph APIs directly using this channel as their support model is through StackOverflow - and yes - we know that it's really hard for partners and customers to use multiple different location, but for Graph API questions - or issues in Graph API - correct location for questions is at https://stackoverflow.com/questions/tagged/microsoft-graph
If all Graph API calls are blocked in SharePoint Framework, then issue is absolutely on SharePoint Framework side and we'll need to have a look on this. @lahuey can comment on the exact roll out situation on the issue he has found.
@VesaJuvonen than you for the work and update on this. I totally understand about the GraphAPI restrictions. I'll test and provide feedback but If there are issues with Graph I'll open up a ticket on the alternate thread. I am not calling Graph graph for external users so I suspect I should be just fine. Thanks again!
@VesaJuvonen Thanks for this quick follow up!
I forgot to mention that the page with the SPFx webpart on it that calls the Graph API is working fine if external users open it in SharePoint itself.
If the same page is displayed in Teams, external users get the error message that I mentioned earlier.
With this new information, should I still post this issue on StackOverflow?
@MistahG are you using cdn on the tenant, in case on/off has an impact here.
@MistahG - After going through lot of articles and attempts with different approaches, below one worked for me.
Manual Steps
Step 1. Go to -> https://aad.portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview
Step 2. Click on SharePoint Online Client Extensibility Web Application Principal
Step 3. Click Manifest on the left menu
Step 4. Remove all entries in the PasswordCredentials section (Should leave a empty array)
Step 5. Save the manifest
Step 6. Visit the new API Permission Management Page on the Tenant Admin Site. This creates a client secret behind the scenes.
Step 7. Waited for 1 day.
Is there any update on when this issue will be fixed? I'm experiencing the issue specifically in the desktop app - my tab loads fine for all users on the teams web client, but in the desktop app it only works for the MOD administrator in our demo tenant.
The error is an artifact of an exception caused by parsing the error message. The fix has been submitted so it should roll out to customers within the next month.
@rapowell9 can you verify that the preauthorization section of the SPO Client Extensibility Application in the App Registrations (AAd Portal) page is not empty?
@lahuey
Yes, I populated that section as described in the previous thread, with the given app id and the permissionsId from the OAuth2Permissions array. Thanks for the update, and glad to hear the fix is nearly out