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

SPFx app inside Microsoft Teams authentication error (sso-getAdalSsoToken-receive)

Open AndresPita opened this issue 4 years ago • 10 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
  • [X] 💥 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

  • Microsoft Teams client
  • SPFx version 1.11
  • Node.js version 10.16.2

Describe the bug / error

For a specific tenant our SPFx app is not working inside the Teams client. However, it is working perfectly fine when using Teams from the browser (Chrome).

It is important to mention that our SPFx app is working fine at 30 other tenants, and something we suspect about this specific tenant is that they made a SharePoint domain name change. After the domain name change, the SPFx app registration in Azure has been configured with the new domain name, as described in the documentation here ("For SPFx applications, in Azure AD update the Authentication URLs to the new domain for the SharePoint Online Client Extensibility Web Application Principal.")

The error seen from inside the Teams client is the following: SPFx auth error sso-getAdalSsoToken-receive

Steps to reproduce

Create SPFx app and authenticate using aadHttpClientFactory Sync app to Teams Change SharePoint domain name (?)

Expected behavior

Our SPFx app inside Teams client should work as for every other tenant.

AndresPita avatar Jan 31 '22 11:01 AndresPita

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

ghost avatar Jan 31 '22 11:01 ghost

@AndresPita - Sorry that you are running into this issue. Is this only happening for the mobile teams client? Does it also repro on the desktop teams client? The reason I ask is that the auth flow that is used in the mobile teams client currently has a bug and a tenant rename will affect/trigger it. This is a known issue and we are working on a fix.

If it is NOT working on the desktop client would it be possible to send me a trace, or tenant details and exact time that you experience this to grahamc at microsoft.com. That would help me investigate the issue if the desktop client is actually broken.

GrahamMcMynn avatar Feb 01 '22 16:02 GrahamMcMynn

@GrahamMcMynn - Thank you for your answer. I have sent you an e-mail with the information. Is there an estimate for when the mobile Teams client bug will be fixed? Is there any workaround?

AndresPita avatar Feb 02 '22 10:02 AndresPita

Hi, in my company we are having the same problem. Right now our components don't work in the Teams Desktop and mobile app. This is a critical issue as our customers are being affected and are unable to use our components in Teams.

Do you have any forecast of when it will be fixed?

Thanks

sortegamartin avatar Feb 08 '22 17:02 sortegamartin

Hi @sortegamartin - I do not have a forecast of when it will be fixed for mobile (however, it is currently being worked on). However, the Teams Desktop app should work. There is currently a known bug that a fix is rolling out for. That being said, the most common reason the teams desktop fails is that the documentation at https://docs.microsoft.com/en-us/sharepoint/dev/spfx/deployment-spfx-teams-solutions is not followed, specifically this: image

If your app is configured correctly as per above the known issue is that the accessTokenAcceptVersion is erroneously set to 2 for the spfx app. A fix is rolling out to prod, but you can mitigate this yourself if you are affected by it. To do this please do the following: Go to portal.azure.com as a global admin Go to app registrations (on the left nav) Select the "SharePoint Online Client Extensibility Web Application Principal" Go to manifests (on the left nav) Ensure that the value of access TokenAcceptedVersion is 1 (It may be 2). ie it should look like: "accessTokenAcceptedVersion": 1, Save changes if you made a change

If neither of these are your problem if you could please reach out to me at grahamc at microsoft.com with a trace of the desktop app failing I would be happy to look into it.

GrahamMcMynn avatar Feb 08 '22 17:02 GrahamMcMynn

We found an issue with this on tenants that do not have matching site subscription ID's and AAD tenant ID's. Unfortunately there is no temporary workaround, however, a fix has been made and will roll out around March 13th. A small percentage of tenants are affected by this issue and it will only affect our fallback logic (ie one of the Mobile clients is being used). Teams Desktop will not be affected by this change unless the wrong resource URL is used in the webApplicationInfo.

GrahamMcMynn avatar Feb 24 '22 18:02 GrahamMcMynn

hey @sortegamartin, can you please check if the issue has been resolved for you now?

lucabandMSFT avatar Mar 15 '22 20:03 lucabandMSFT

Hi @lucabandMSFT, yes, it already works in the Teams mobile app 🎉 Thank you very much!

sortegamartin avatar Mar 15 '22 22:03 sortegamartin

glad to hear that.. I'm going to close this issue

lucabandMSFT avatar Mar 15 '22 22:03 lucabandMSFT

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

ghost avatar Mar 23 '22 00:03 ghost