thymeleaf / thymeleaf-extras-springsecurity

Thymeleaf "extras" integration module for Spring Security 3.x and 4.x
http://www.thymeleaf.org
Apache License 2.0
477 stars 107 forks source link

sec: authorize, hidden display problem #51

Open ss96766 opened 6 years ago

ss96766 commented 6 years ago

I've introduced thymeleaf-extras-springsecurity4 in pom. html page namespace is also added http://www.thymeleaf.org/extras/spring-security. But why I did not log in, sec: authorize = "isAuthenticated ()" This can not be hidden

danielfernandez commented 6 years ago

I'm not sure I understand your problem. Could you please be more specific?

If what you say is that a sec:authorize attribute still appears in your executed template, my question would be: are you using Spring Boot? if not, there is no reason the SpringSecurity Dialect would have registered itself, so besides adding the dialect to the pom.xml you'd need to add your dialect to the TemplateEngine as explained in the documentation.

StupidPz commented 6 years ago

I have the same problem.And i'm using SpringBoot.I tried thymeleaf-extras-springsecurity4 and thymeleaf-extras-springsecurity3,but failed.I still could see the sec element using F12 .it seemd that was not resovled by thymeleaf

Kingsearch commented 6 years ago

@StupidPz me too

marccollin commented 6 years ago

specify your spring boot version, please...

StupidPz commented 6 years ago

@Kingsearch @marccollin try to change the version.it should work.

<thymeleaf.version>3.0.8.RELEASE</thymeleaf.version>
<thymeleaf-layout-dialect.version>2.2.2</thymeleaf-layout-dialect.version>
<thymeleaf-extras-springsecurity4.version>3.0.2.RELEASE</thymeleaf-extras-springsecurity4.version>
dokle commented 6 years ago

Worked for me with the versions specified by @StupidPz , thank you :). I've just changed the version of thymeleaf-layout-dialect.version to 2.3.0

I'm using Spring Boot Version 2.0.1.RELEASE

jalmoreno commented 5 years ago

@StupidPz @dokle thanks!!

It took me a lot of time!

My properties:

3.0.9.RELEASE 2.2.2 3.0.4.RELEASE