sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

Graph API not working in Teams MOBILE client

Open petrp314 opened this issue 4 years ago • 49 comments

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

💥 SharePoint Framework

Developer environment

Windows

What browser(s) / client(s) have you tested

  • [ ] 💥 Internet Explorer
  • [ ] 💥 Microsoft Edge
  • [ ] 💥 Google Chrome
  • [ ] 💥 FireFox
  • [ ] 💥 Safari
  • [X] mobile (iOS/iPadOS)
  • [ ] mobile (Android)
  • [ ] not applicable
  • [X] other (enter in the "Additional environment details" area below)

Additional environment details

  • Teams mobile client on IOS and Sharepoint iOS app
  • SPFx 1.13

Describe the bug / error

I have a simple spfx solution with Graph API request to get /users. When I run the solution in SPO page on windows browser, teams desktop windows client or SPO page in mobile ios browser, all is working.

When I run the solution on IOS mobile in Teams or SharePoint app, the graph api request is not working. It returns odata.error undefinedthe AadHttpClient is created successfully, but the actual api call is not working. It is not possible to troubleshoot this on mobile teams so I am not sure about the actual error if any.

Basically mobile Teams and mobile SharePoint app is not executing the graph call. Sharepoint REST API calls are working in the same solution on all platforms and apps.

Steps to reproduce

  1. Simple spfx solution
  2. Call made to graph api
  3. Mobile teams app is not executing

Expected behavior

Working graph api call on mobile ios apps for Teams and Sharepoint.

petrp314 avatar Jan 12 '22 21:01 petrp314

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

ghost avatar Jan 12 '22 21:01 ghost

I am updating with an isolated source code.

client.api("users").version("v1.0").select(["id", "userPrincipalName"]).get() .then((users) => { console.log(users); }) .catch(err => { console.log("error!!!" + err); })

The code successfully works on: Windows browser in SPO, Teams desktop app, Teams in browser The code goes into catch statement on: iOS Teams app, Sharepoint app

petrp314 avatar Jan 14 '22 10:01 petrp314

I have a repro on SharePoint Mobile app on Android with same app Screenshot_20220114-181706_SharePoint

sosandu avatar Jan 14 '22 16:01 sosandu

This is for now a known issue. The Teams mobile team is working to fix this scenario and we will provide an update on this issue to share the progresses with all of you. In the meantime, the only viable workaround is to log in to SharePoint via a browser first.

We are also going to close all the other issues on this topic as dupe to this issue so we can have a single item to track and share progresses.

lucabandMSFT avatar Jan 18 '22 19:01 lucabandMSFT

@lucabandMSFT Hello Luca, thanks for the reply. It is very good that we have confirmed it is a known bug and resolution is on its way. I will be monitoring other referenced issues. Thank you very much!

petrp314 avatar Jan 19 '22 08:01 petrp314

@lucabandMSFT Hello Luca,

Is there any updates with this issue?

Thank you for your effort.

efeaktasvalprovia avatar Jan 21 '22 13:01 efeaktasvalprovia

@lucabandMSFT hello Luca, we are getting the following exception message: {"odata.error":{"code":"10009","message":{"lang":"de-DE","value":"The target resource is invalid because it does not exist, cannot be found, or it is not correctly configured."}}} It would be great, if we can get any information about the solution. Thank you!

cagdasdavulcu avatar Jan 21 '22 14:01 cagdasdavulcu

@lucabandMSFT Hi Luca,

we are getting same Error from Teams Desktop Client:

{"odata.error":{"code":"10009","message":{"lang":"de-DE","value":"The target resource is invalid because it does not exist, cannot be found, or it is not correctly configured."}}}

It is working from SharePoint and from Teams browser version.

Benny183 avatar Jan 21 '22 16:01 Benny183

@cagdasdavulcu , @Benny183, if this is happening on the Teams desktop client, and not mobile, do you mind opening an new issue to properly track it please?

@efeaktasvalprovia : that's work in progress right now: I will update the thread as soon as I have more details on release plan

lucabandMSFT avatar Jan 24 '22 22:01 lucabandMSFT

Same experience here with one of our new customers. What's quite awkward ist that we can see our tool (also an SPFx WebPart synced to Teams) working well (even on native apps on iOS and Android devices) in existing environments.

@lucabandMSFT can you give us more information about possible cases / setups / environments etc. where/when this problem occurs? Thanks.

arnoldmatusz avatar Feb 02 '22 10:02 arnoldmatusz

Hi @arnoldmatusz, as long as you log in to SharePoint first in a browser, Mobile works. Is when you never logged in to SharePoint that the problem occurs.

The good news is that the team is actively working on a fix so I believe I will be able to provide an update this month.

lucabandMSFT avatar Feb 02 '22 14:02 lucabandMSFT

Hi @lucabandMSFT, as that workaround failed for us, could you please elaborate more on the exact steps required? I suppose we need to log in with a browser on the mobile device, not on a PC? If the user has more than one browser installed on his device, which one should he use? And is he supposed to open the site connected to the Team where the app is installed or does any SharePoint site do?

cwdata avatar Feb 02 '22 15:02 cwdata

Hi @lucabandMSFT thanks for the quick response. Unfortunately it's the same here, as for @cwdata . Is your workaround also expected to work, when the original call is towards a webservice within Azure (connected to the same Azure AD)? We are experiencing the exact same behaviour when calling a webservice on our web app on Azure? Thanks in advance.

arnoldmatusz avatar Feb 02 '22 15:02 arnoldmatusz

Hello all, I have also tried the workaround on iOS device without luck. I logged off from Teams app, opened the browser (Edge), logged to SPO site with the webpart on the page and got the results from Graph API correctly. Then I opened Teams app, opened the app with same webpart as in browser and got the error message.

@lucabandMSFT Can you please provide more details regarding the discussed workaround? Thanks a lot.

petrp314 avatar Feb 02 '22 20:02 petrp314

Thanks for the feedback folks. Logging in with the same user on a browser (no matter if you log in via browser in the mobile or desktop) should temporarily unlock the scenario. But we know that is quite unreliable as a behavior which is why the team is working on a better solution as we speak.

Another question: do you have any conditional access policy in place in accessing the page from Teams or in accessing the specific API?

lucabandMSFT avatar Feb 02 '22 21:02 lucabandMSFT

No conditional access policies in our case.

Can you give us a litte more background to this? We have our functionality running flawlessly on multiple tenants and currently one that's causing the error message and behaviour above.

To be sincere we've already seen this behaviour multiple times (ca. 30% of cases) and we managed to solve the problem by deleting the "SharePoint Online Client Extensibility Web Application Principal" app registration and having it recreated by navigating to API Access in the SharePoint Administration. But this time, the deletion doesn't seem to help.

Thanks again!

arnoldmatusz avatar Feb 02 '22 21:02 arnoldmatusz

@arnoldmatusz , that seems quite uncommon. is it possible for you to collect a trace and send it to us please?

lucabandMSFT avatar Feb 02 '22 21:02 lucabandMSFT

I use my simple tenant for testing without conditional access configured. I have not tried the recreation of the principal account. However logging with the browser is not fixing it at all.

petrp314 avatar Feb 02 '22 21:02 petrp314

@plodik, can you share your email here? @GrahamMcMynn and I will follow up with you directly.

lucabandMSFT avatar Feb 02 '22 21:02 lucabandMSFT

@arnoldmatusz , that seems quite uncommon. is it possible for you to collect a trace and send it to us please?

Hi @lucabandMSFT ... I'm sure our client will allow us to share this information privately. How do I contact you?

arnoldmatusz avatar Feb 02 '22 23:02 arnoldmatusz