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:
+25
@@ -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>
|
||||
Reference in New Issue
Block a user