Category: Software, Database

This article shows how to implement authentication and authorization in Spring Boot Vaadin Flow applications without using Spring Security.

Vaadin hides this paradigm so you can focus on the application and UI logic without having to deeply understand the underlying web technologies.

Create a new AuthService class to encapsulate the authentication and authorization logic: The authenticate method tries to find a user in the database with the given credentials and if it succeeds, a reference to the user is stored in the session and the available routes (links to views in the application) are created for the corresponding user role.

Keep in mind that this code is intended to be an example of how you can use the RouteConfiguration class to register routes at runtime for authorization reasons and might not be production-ready.

Related Articles