Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using spring security with thymleaf in my project. I want to use thymleaf security tag in my project.I have added some of the dependency in my project but it is not working

In my pom.xml
 <dependency>
     <groupId>org.springframework.boot</groupId>
     <artifactId>spring-boot-starter-security</artifactId>
 </dependency>

<dependency>
    <groupId>org.thymeleaf.extras</groupId>
    <artifactId>thymeleaf-extras-springsecurity4</artifactId>
</dependency>
 <dependency>
     <groupId>org.springframework.boot</groupId>
     <artifactId>spring-boot-starter-thymeleaf</artifactId>
 </dependency>

The spring security header tag i have used

<html lang="es" xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/extras/spring-security">


tag i have been using
<div sec:authorize="!isAuthenticated()">

/div>


What I have tried:

i have tried by adding all the dependency on by one and checking it is not hiding my details while it is authenticating.Please help me...
Posted
Updated 8-Feb-20 6:57am
v2
Comments
Mohibur Rashid 8-Feb-20 20:51pm    
add another field in your modelAndView(I presume) and use that not, the function.
aayushkc2158 10-Feb-20 6:31am    
i did but not working
Mohibur Rashid 12-Feb-20 6:33am    
Source code please?
aayushkc2158 13-Feb-20 5:48am    
https://github.com/kcaayush2158/CupidLove
Mohibur Rashid 13-Feb-20 20:20pm    
It is difficult to help you. you shared the entire source code and your sourcecode does not contain isAuthenticated() function anywhere. Where are you calling this?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900