thymeleaf / thymeleaf-extras-springsecurity

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

Haven't released the thymeleaf-extras-springsecurity5 dependency yet? #58

Closed FirstJavaMaster closed 5 years ago

FirstJavaMaster commented 5 years ago

I created a new project that uses springboot 2.0.5.RELEASE and its associated spring-boot-starter-security and spring-boot-starter-thymeleaf. Just like this:

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

I want to display the user name that is currently logged in on the thymeleaf-based html page. According to the information I found, I should add the following content to the html page

<span sec:authentication="name">Bob</ Span>

However, after opening the corresponding page, the sec:authentication tag displayed in the navigation console is not parsed correctly, because it is still "the original look".

image

I found that I should add thymeleaf-extras-springsecurity X to the pom.xml file. But I can only get the thymeleaf-extras-springsecurity4 dependency, not thymeleaf-extras-springsecurity5 Dependence. There are no search results in the central maven repository, and when I use

<dependency>
    <groupId>org.thymeleaf.extras</groupId>
    <artifactId>thymeleaf-extras-springsecurity4</artifactId>
    <version>3.0.3-SNAPSHOT</version>
</dependency>

or

<dependency>
    <groupId>org.thymeleaf.extras</groupId>
    <artifactId>thymeleaf-extras-springsecurity4</artifactId>
    <version>3.0.2.RELEASE</version>
</dependency>

can't download dependencies.

So, what should I do now to make my page display the username?

danielfernandez commented 5 years ago

Please note that thymeleaf-extras-springsecurity5 (version 3.0.3.RELEASE) has just been published.

FirstJavaMaster commented 5 years ago

Nice!!!