- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2023 09:31 AM - edited 07-25-2023 08:40 PM
Hi Everyone;
I am trying to embed virtual agent window into external page.
Method:
Step 1: Obtain the URL for embedding the chat
ven04940.service-now.com/sn_va_web_client_app_embed.do
Step 2:Copy the URL and add it into an iframe element
<iframe src="https://ven04940.service-now.com/sn_va_web_client_app_embed.do" title="Test"></iframe>
Step 3: Enable iframe embedding of the chat in NOW.
After following above steps I am getting error like this:
And it is saying ven04940.service-now.com refused to connect.
Can anyone guide me with this.
cc: @Ankur Bawiskar @Community Alums @Pavankumar_1 @kamlesh kjmar
Thanks in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2023 10:55 PM
Hi @Virendra Dwived ,
My previous post was generic for servicenow pages, I missed your question was specific to VA embedding. For VA embeddment servicenow has given a way to override 'sameorigin' policy using system property. The property that you have overridden as shown in the screen shot is the right one. The issue that is there is the format of the URL you have used. You don't need to provide the page level URL. Just mention the base URL of teh site where you want to use it.
For an example, let's say I want to embed my VA in w3school web site, in that case I will mention that site's base URL and seave , as shown in the below screen shot:
If you put a close attention to the screen shot, you will find value of the property I have set as space separated, you can include multiple sites just make sure all are space separated.
As you can see in the above screent shot, it's working now.
I hope this helps.
Please mark this post as Helpful if this helps and Accept if it resolves your issue.
Regards,
Kamlesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2023 09:41 PM
Hi @Virendra Dwived ,
Unfortunately, you can't do this. What you are getting is an expected behaviour. Any page of servicenow can't be embeded as iframe in any other site. Doing this violates the Content Security Policy directive. As per this directive any page can be embedded only on a site of the same origin. In simple term you can embed servicenow page as an iframe on the same instance page only, as in that case origin of the page to be embeded and page on which it is embedding are same.
So, if I try to embed a page that belongs to your instance on a page of my instance it won't work and will throw below errors.
But I can embed any page of my instance on any other page of my instance.
You can learn more about Content Security Policy (CSP) here
I hope this helps.
Please mark this post as Helpful if this helpa and Accept if it resolves your issue.
Regards,
Kamlesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2023 10:55 PM
Hi @Virendra Dwived ,
My previous post was generic for servicenow pages, I missed your question was specific to VA embedding. For VA embeddment servicenow has given a way to override 'sameorigin' policy using system property. The property that you have overridden as shown in the screen shot is the right one. The issue that is there is the format of the URL you have used. You don't need to provide the page level URL. Just mention the base URL of teh site where you want to use it.
For an example, let's say I want to embed my VA in w3school web site, in that case I will mention that site's base URL and seave , as shown in the below screen shot:
If you put a close attention to the screen shot, you will find value of the property I have set as space separated, you can include multiple sites just make sure all are space separated.
As you can see in the above screent shot, it's working now.
I hope this helps.
Please mark this post as Helpful if this helps and Accept if it resolves your issue.
Regards,
Kamlesh