Building, integrating, or customizing apps and workflows within Microsoft Teams using developer tools and APIs
Thank you for posting your question in the Microsoft Q&A forum.
Based on your description, I understand that your custom Teams tab app (web-based) works in the web client but shows a blank screen in the desktop client. After conducting research, here are some insights I’ve gathered that may help clarify the issue and guide you toward a resolution:
- CSP and X-Frame-Options headers
The Teams desktop client enforces stricteriframerules than the web client. If your Azure-hosted app does not explicitly allow embedding from Teams domains via CSP headers, it may fail to render.
You should include aContent-Security-Policyheader with theframe-ancestorsdirective that allows:
This configuration is documented in Requirements for Building Tabs.frame-ancestors 'self' https://teams.microsoft.com https://*.cloud.microsoft;
Avoid usingX-Frame-Options: DENYorSAMEORIGIN, as these will blockiframeembedding in Teams. - Login pages inside
iframeare blocked
Microsoft security policy disallows rendering login pages (e.g.,login.microsoft.com) insideiframesto prevent clickjacking. This is a known cause of blank screens in the desktop client even when authentication succeeds.
Recommended workaround: Use SSO for tab app. You can see this article for more information: https://learn.microsoft.com/en-us/microsoftteams/platform/tabs/how-to/authentication/tab-sso-overview - Nested
iframesare unsupported
Teams tab apps themselves are loaded asiframes. If your app contains another iframe inside it (nested iframe), it may not render properly.
This behavior is clarified in this thread discussion: https://learn.microsoft.com/en-us/answers/questions/1180852/loading-a-web-app-as-iframe-in-teams-tab-applicati - Workaround
Ififrameembedding isn’t feasible due to policy restrictions, you can guide users to open the tab in a browser using the “Open in browser” banner.
This workaround is documented in Websites not loaded in new Teams.
Let me know if you’d like help reviewing your manifest or CSP headers. Happy to assist further!
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.