Skip to main content
July 11, 2023
Solved

Content Security Policy error in my SAIL or User Interface Plugin

  • July 11, 2023
  • 7 replies
  • 0 views

Hi Team,

I am creating a sail extension or javascript based UI plugin (Chatbot), it worked perfectly without adding any Content Security Policy (no meta tag added) from VS Code, but when I deployed the plugin in my VM (where appian is installed), it is throwing out Content Security Policy errors in the console. Please help.

[Report Only] Refused to load the script '<js_source_link>' because it violates the following Content Security Policy directive: "default-src 'self'". Note that 'script-src-elem' was not explicitly set, so 'default-src' is used as a fallback.

[Report Only] Refused to load the script '<js_source_link>' because it violates the following Content Security Policy directive: "default-src 'self'". Note that 'script-src-elem' was not explicitly set, so 'default-src' is used as a fallback.

[Report Only] Refused to load the stylesheet '<css_source_link>' because it violates the following Content Security Policy directive: "default-src 'self'". Note that 'style-src-elem' was not explicitly set, so 'default-src' is used as a fallback.

CC: [mention:f9a66b450e5e4f61b65d05eb846c079f:e9ed411860ed4f2ba0265705b8793d05] [mention:126a676c85024855948336691b0a7b92:e9ed411860ed4f2ba0265705b8793d05] [mention:b45a4f6a20b14a008e4e0ec732a8bf98:e9ed411860ed4f2ba0265705b8793d05] [mention:adb98a54369049d19dbc03825a3132e4:23b05a61c3e5445190d9bfa00453bce4] 

Thanks,

Bharathwaj RK

bharathwaj.rk@roboyo.com.au

Best answer by bharathwajr6427

Thank you for your help [mention:126a676c85024855948336691b0a7b92:e9ed411860ed4f2ba0265705b8793d05]. Despite of setting all the dynamic url and details set as per Appian suggestion in custom.properties, etc/hosts, I saw some errors related to Content-Security Policy as [Report Only].

The errors in the console were only [Report Only] and we can ignore them as per Appian. But I wondered why my UI not rendered as expected and inspected the iframe (SAIL Component) in Appian Interface and found that height was not set properly to body tag which was the cause for my Plugin not showing in the UI.

After I set the body tag height based on the sail component's parameter height, my sail component worked as expected.

Regards,

Bharathwaj RK

7 replies

stefanhelzle0001
July 11, 2023

Did you check this: https://docs.appian.com/suite/help/23.2/component-security-performance.html

Specifically the first section about component isolation.

July 11, 2023

Thank you Stefan, yes I have modified the dynamic server details in my VM's custom.properties. But still seeing this error.

stefanhelzle0001
July 11, 2023

Hm... did you see that these are just notifications and no error messages? Does the plugin work?

I suggest to contact Appian for more detailed infos.

bharathwajr6427AuthorAnswer
July 13, 2023

Thank you for your help [mention:126a676c85024855948336691b0a7b92:e9ed411860ed4f2ba0265705b8793d05]. Despite of setting all the dynamic url and details set as per Appian suggestion in custom.properties, etc/hosts, I saw some errors related to Content-Security Policy as [Report Only].

The errors in the console were only [Report Only] and we can ignore them as per Appian. But I wondered why my UI not rendered as expected and inspected the iframe (SAIL Component) in Appian Interface and found that height was not set properly to body tag which was the cause for my Plugin not showing in the UI.

After I set the body tag height based on the sail component's parameter height, my sail component worked as expected.

Regards,

Bharathwaj RK

January 2, 2024

Hi Bharath,

I am also facing the same issue.Can you elaborate more about the fix? Did u update the body tag height in the component plugin source code?

Regards,

Subha

January 5, 2024

Yes [mention:1aab0d38595c4a528fe7273d3b64a39b:e9ed411860ed4f2ba0265705b8793d05], after setting the default height for my plugin, I was able to see the plugin in the appian interface. I also handled the code so that based on the height value provided, I set the plugin height respectively.

Thanks,

Bharathwaj RK