Member-only story

User Authentication with Spring Security and MariaDB

Ryan Deschamps
5 min readApr 21, 2023

--

People learning Spring for the first time will find that certain tutorials will only get them so far. Spring Security is one of those tutorials. For example, most tutorials will show how to set up a basic security configuration with a deeply problematic `InMemoryUserDetailsService` with hard-coded usernames, passwords and authorities or roles. This approach also comes with a deprecation warning that will remind developers that it is insecure to use this approach in production. Okay fine. But why are we building secure websites that are not secure in production? That seems futile. What do we do when our bosses actually want us to do good work?

Database-ready Spring Boot Security

This tutorial is going to assume you know a few things about Spring:

  • That you understand how to set up a project using the Spring Initializr or via an IDE like VS Code or Eclipse.
  • That you know the basic of Spring Boot Application Design including how to set up a Controller and Spring Boot Application.
  • You have reasonable in-depth knowledge of a Spring UI approach such as with Thymeleaf or Vaadin.
  • Familiarity with a data source of your choice (we will use MariaDB as the example in this tutorial).
  • Removing boilerplate java code via Lombok.
  • In sum, this is not a beginner tutorial. We are going to look at production-ready Spring.

--

--

Ryan Deschamps
Ryan Deschamps

Written by Ryan Deschamps

College professor covering just about everything tech and policy.

No responses yet