Using Vaadin with Spring Boot and Spring Security
This demo shows how to integrate Spring Security with a Vaadin application. The demo uses Spring Boot together with the official Vaadin Spring Boot integration library (vaadin-spring-boot-starter) and Spring Security.
Using Spring Security together with single-page applications is a bit tricky since the default setup for Spring Security targets MVC frameworks in the first place, such as Spring MVC, with full page reloads and the possibility to employ servlet filters for security interceptions. Using Spring Security with Vaadin means that you have to glue various parts of Spring Security and Vaadin together yourself.
This demo shows you how to do that. It makes use of Spring's @Secured annotation to secure individual service methods and uses view interception to redirect users to a login page if they try to perform a restricted operation.
To run the example, Apache Maven is needed. You can simply start the application by issuing the following command:
$ mvn package spring-boot:run
After the web container was successfully started, you can visit the demo application with your browser at the following address: http://localhost:8080
This project is hosted on GitHub: https://github.com/rolandkrueger/vaadin-by-example