BAEL-5638: Added display logged-in user details in Thymeleaf tutorial (#12524)

* BAEL-5638: Added display logged-in user details in Thymeleaf tutorial

* BAEL-5638: Removed unneeded security config
This commit is contained in:
Adrian Bob
2022-08-04 06:54:49 +03:00
committed by GitHub
parent 8ec8c01a67
commit 81b05fb3ac
9 changed files with 328 additions and 0 deletions
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<head>
<title>Welcome to Spring Security Thymeleaf tutorial</title>
</head>
<body>
<h2>Welcome</h2>
<p>Spring Security Thymeleaf tutorial</p>
<div sec:authorize="hasRole('USER')">Text visible to user.</div>
<div sec:authorize="hasRole('ADMIN')">Text visible to admin.</div>
<div sec:authorize="isAuthenticated()">Text visible only to
authenticated users.</div>
Authenticated username:
<div sec:authentication="name"></div>
Authenticated user's firstName:
<div sec:authentication="principal.firstName"></div>
Authenticated user's lastName:
<div sec:authentication="principal.lastName"></div>
Authenticated user's email:
<div sec:authentication="principal.email"></div>
Authenticated user roles:
<div sec:authentication="principal.authorities"></div>
</body>
</html>