diff options
| author | Kamal Wickramanayake <kamal@inbox.lk> | 2026-06-13 18:13:59 +0530 |
|---|---|---|
| committer | Kamal Wickramanayake <kamal@inbox.lk> | 2026-06-13 18:13:59 +0530 |
| commit | 6ae21cd4e51756ea14b43b82a9d500bca9fb8032 (patch) | |
| tree | a330377fff7709cae00fe9d39c9281809e09aa75 /spring-boot/08-spring-security-simple/README | |
| parent | fa880db84ec4507010a4d29b7cb0308f82553834 (diff) | |
Added 08-spring-security-simple
Diffstat (limited to 'spring-boot/08-spring-security-simple/README')
| -rw-r--r-- | spring-boot/08-spring-security-simple/README | 19 |
1 files changed, 19 insertions, 0 deletions
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 |
