Thymeleaf

  1. Error: Refused to load the stylesheet ‘some redirect url to ADFS‘ because it violates the following content Security Policy directive default-src ‘self’.

Root cause:

ADFS tries to redirect the request for the css for authentication because of the below link tags.

<link th:href=”@{/stlyles/css/bootstrap.min.css}” rel=”stylesheet”/>

<link th:href=”@{/stlyles/css/all.min.css}” rel=”stylesheet”/>

Solution:

To avoid that CSS redirect for ADFS, just use the plain link tag as below.

<link href=”/styles/css/bootstrap.min.css” rel=”stylesheet”/>

<link href=”/styles/css/all.min.css” rel=”stylesheet”/>

%d bloggers like this: