How to configure the NICE DCV Web Client to work in iFrames

NICE DCV offers native DCV clients for Windows, Linux and MacOS for best performance but also the convenient HTML5 browser-based NICE DCV client.

For strongest security the DCV web client by default does not allow to be embedded inside an iFrame to avoid “clickjacking” attacks. There are scenarios where you have a controlled environment and want to embed the DCV remote desktop client into another website. This guide shows how this is possible configuring respective HTTP headers.

To configure the NICE DCV server on Windows to allow embedding as iFrame the following HTTP headers are configured in the Windows registry.

In HKEY_USERS\S-1-5-18\Software\GSettings\com\nicesoftware\dcv\connectivity we set 2 Strings (SZ) in case we want to show the iFrame as part of a page on e.g. as follows (usually you can skip the “web-x-frame-options” entry as it has become obsolete, please replace with your domain name):

web-x-frame-options ALLOW-FROM
web-extra-http-headers  [("Content-Security-Policy", "frame-ancestors https://*")] 

If you prefer Powershell you can set the “web-extra-http-headers” option with the following Powershell command (please replace with your domain):

New-ItemProperty -Path "Microsoft.PowerShell.Core\Registry::\HKEY_USERS\S-1-5-18\Software\GSettings\com\nicesoftware\dcv\connectivity\web-extra-http-headers" -Name parameter_name -PropertyType String -Value "[('Content-Security-Policy', 'frame-ancestors https://*')]" -Force

In case of DCV on Linux you can set the HTTP headers in the dcv.conf file – here an example:

web-extra-http-headers=[("Content-Security-Policy", "frame-ancestors https://*")]

If you want to allow any https connection you can use “frame-ancestors https:“.

More about clickjacking: and

Any questions please feel free to contact us.