I struggle to get Thymeleaf to work with Spring Security in my Spring Boot 1.4.3 based project.
Tags like e.g.
<div sec:authorize="hasAuthority('ADMIN')">
are simply not parsed.
If I try to add the SpringSecurityDialect
manually like this:
@Bean
public SpringSecurityDialect securityDialect() {
return new SpringSecurityDialect();
}
I am getting:
Exception in thread "main" java.lang.NoClassDefFoundError: org/thymeleaf/dialect/IExpressionEnhancingDialect
I have included the following in my dependencies:
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-springsecurity4</artifactId>
</dependency>
The SpringSecurityDialect
does not seem to be added by the autoconfiguration.
After I add the Bean manually, I get the mentioned exception.
Is this a bug or am I missing something?
My Thymeleaf versions are:
<thymeleaf.version>3.0.2.RELEASE</thymeleaf.version>
<thymeleaf-extras-java8time.version>3.0.0.RELEASE</thymeleaf-extras-java8time.version>
<thymeleaf-layout-dialect.version>2.1.2</thymeleaf-layout-dialect.version>