Web page/iFrame within Teams is unable to connect to your ServiceNow instance
Background:
When installing specific plugins for Teams, ServiceNow creates HTTP response headers to address Cross-Origin Resource Sharing (CORS) between Microsoft and ServiceNow, however, these headers don't apply to all pages. As a result, some pages like a link to a KB article or an incident record will not be able to display within Teams. To address this, we'll create a new response header to give permission to teams.microsoft.com for all ServiceNow pages.
Known Issue:
Use a custom portal instead of Employee Center and/or installed "Conversational Integration with Microsoft Teams" v3.0.6
Note: To change Employee Center to a custom portal, change the value for sn_now_teams.portal.suffix in sys_properties.list.
Solution:
- On your ServiceNow instance, elevate your admin role to "security_admin".
- Make sure you are in Global scope.
- Go to sys_response_header.list
- Click on "New" button.
- Fill out the following:
Applies to: All Pages
Name: Content-Security-Policy
Value: frame-ancestors 'self' teams.microsoft.com *.teams.microsoft.com
After creating HTTP Response Header:
https://www.servicenow.com/community/ms-teams-articles/web-page-iframe-within-teams-is-unable-to-connect-to-your/ta-p/2314033