OfficeDev / microsoft-teams-library-js

JavaScript library for use by Microsoft Teams apps
https://docs.microsoft.com/microsoftteams/platform/
Other
419 stars 192 forks source link

Teams app tab pointing to SharePoint site does not work #2389

Open catmanjan opened 2 weeks ago

catmanjan commented 2 weeks ago

We have a Teams app tab which is just a URL of a SharePoint site, the page appears to load but then stalls when it gets to the authentication section

We have added login.microsoftonline.com to the allowed domains but this made no difference

image

catmanjan commented 2 weeks ago

Also I have discovered that if the user uses the "Go to website" button to launch SharePoint in the browser, the tab in Teams then works, this leads me to believe there is some sort of cookie or session acquisition issue at play... Probably related to my other ticket #2390

catmanjan commented 1 week ago

I fixed 2390 by adding SameSite=None to the auth cookie, I believe something similar needs to happen with SharePoint to allow it to work

Nivedipa-MSFT commented 1 week ago

@catmanjan - Thanks for reporting your issue. Could you please add the SharePoint site URL in validDomains section? Could you please confirm is this a same tenant sharepoint Url where your app is uploaded? If the tenant is different then could you please check that you have granted permissions to the guest users in your tenant? Check this documenataion for further information.

catmanjan commented 1 week ago

@Nivedipa-MSFT I have done this, and yes it is the same tenant.

I even tried the suggestions here https://blog.yannickreekmans.be/show-sharepoint-page-in-microsoft-teams/ but they do not seem to work any more

Nivedipa-MSFT commented 1 week ago

@catmanjan - Sign-in pages don't render in iFrames as a safeguard against clickjacking. Your authentication logic needs to use a method other than redirect. For example, use token-based or cookie-based authentication. Could you please let us know how you are implementing authentication in SharePoint tab?

catmanjan commented 6 days ago

@Nivedipa-MSFT SharePoint uses cookie authentication so this should work - this is just a stock standard Microsoft SharePoint Online tab.