Embedding the Service Portal inside an html iframe

Community Alums
Not applicable

Hi,

I have been asked if it is possible to embed our ServiceNow Service Portal within an iframe on our internal intranet page. The business are keen to get people using the knowledge base and service portal which we have built but want them to have access to these within the wrapper oif the exisiting intranet page (e.g. retain the businesses top and side navigation menus).

We have discovered the below article which discribes switching off the glide.set_x_frame_options property which will stop the X-Frame-Options response header being set to SAMEORIGIN for all UI pages (which is the default).

https://community.servicenow.com/community?id=community_question&sys_id=3b78cfeddb1cdbc01dcaf3231f96...

I'm going to test the above on my personal dev instance but even if it works the issue I have is that this is a global true/false setting and I can't specify which hosts should be permitted to embed the servicenow pages. Also I am not sure if this is the best way forward or if theres another option for embedding the ServiceNow service portal within a webpage?

Just need some advice and guidance please.

Thanks for reading and thank for any help in advance  šŸ™‚ Francis

4 REPLIES 4

Sirmyself
Giga Contributor

I have been working on a similar request for a client for months and can't figure a way to implement it properly. 

If you only need to display content, you can set the system property "glide.set_x_frame_options" 's value to "false" and create an IFrame in your website like so :

<iframe src="your-instance.service-now.com/page-to-display.do" height="1000px" width="900px" />

It has work for us to display and navigate our instance, but unfortunately, we can't find a way to make the forms work as there seem to have some variables in the scripts that are probably defined on server side while the website tries to access them on the client side.

I would like any other answer to actually make the whole portal work properly, but right now, I found no way.

Girish Katti
Giga Contributor

HI,

 

Were you able to get the embedded link working in servicenow by setting glide.set_x_frame_options to false.

I was not able even by setting glide.set_x_frame_options to false and I not able to get content within servicenow because of the error

"Refused to display 'https://site-name' in a frame because it set 'X-Frame-Options' to 'deny'".
 
Now is the problem within servicenow or outside servicenow I'm not able to figure out.
 
Thanks 
Girish

jamesmcwhinney
Giga Guru

I havent tried this yet, but this sounds promising:

 

ServiceNow, Service Portal & iFrames: A 2021 Update - Dylan Lindgren

Community Alums
Not applicable