logo

NJP

Web page/iFrame within Teams is unable to connect to your ServiceNow instance

Import · Mar 11, 2022 · article

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.

image

Solution:

  1. On your ServiceNow instance, elevate your admin role to "security_admin".
  2. Make sure you are in Global scope.
  3. Go to sys_response_header.list
  4. Click on "New" button.
  5. Fill out the following:
    Applies to: All Pages
    Name: Content-Security-Policy
    Value: frame-ancestors 'self' teams.microsoft.com *.teams.microsoft.com

image

After creating HTTP Response Header:

image

View original source

https://www.servicenow.com/community/ms-teams-articles/web-page-iframe-within-teams-is-unable-to-connect-to-your/ta-p/2314033