From 6ae21cd4e51756ea14b43b82a9d500bca9fb8032 Mon Sep 17 00:00:00 2001 From: Kamal Wickramanayake Date: Sat, 13 Jun 2026 18:13:59 +0530 Subject: Added 08-spring-security-simple --- spring-boot/08-spring-security-simple/README | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 spring-boot/08-spring-security-simple/README (limited to 'spring-boot/08-spring-security-simple/README') diff --git a/spring-boot/08-spring-security-simple/README b/spring-boot/08-spring-security-simple/README new file mode 100644 index 0000000..b0fab0c --- /dev/null +++ b/spring-boot/08-spring-security-simple/README @@ -0,0 +1,19 @@ +This sample project shows how to add Spring Security to a Spring Boot application. + +To run with support for hot swap during development, use the dev profile as follows: + + mvn spring-boot:run -Dspring-boot.run.profiles=dev + +Two dependencies have been added to pom.xml. + +After starting the application, look for the default password that appears on the console. + +The default user name is 'user' without quotes. + +Access the Contact page from a web browser and observe that a CSRF token has got added to the form html automatically. + +The application has been modified to show a logout link in the main navigation bar. + +Check how that link has been added in the main.html file where the link is visible only if the user has logged in. + +Since all pages of the application are secured (except the login page), the logout link could have been displayed without using the sec:authorize attribute. It has been used in the web page just to show the capability. It is useful in cases where some pages are shown to unauthenticated users. \ No newline at end of file -- cgit v1.2.3