Skip to main content

Mini Project: Form Login, CSRF and Method Security

Learn Mini Project: Form Login, CSRF and Method Security (Spring MVC Security Integration, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Mini Real-Time Project: Form Login, CSRF and Method Security Problem A web application needs a login page, protection against forged form posts (CSRF), different pages for ordinary users and administrators, and a rule on a service method itself. Verify each rule by driving the secured MVC application. Requirements Redirect anonymous visitors to the login page. Process a form login with username and password. Require a CSRF token on state-changing requests. Restrict /admin/** to the ADMIN role. Protect a service method with @PreAuthorize. Concepts Used Spring Security with MVC formLogin CSRF...

More lessons in Spring MVC Security Integration