NOTE: This example is for Vaadin 17. Since that there has been improvements for Spring Security support, like declarative roles checking (using annotations to views). A more up-to-date example can be downloaded via start.vaadin.com by enabling "Access control" on on the settings tab.
An example of how to implement authentication and authorization in Vaadin Flow apps.
Watch the tutorial at https://www.youtube.com/watch?v=oMKks5AjaSQ