chapter two

2 Hello Spring Security

 

This chapter covers

  • Creating your first project with Spring Security
  • Designing simple functionalities that use the basic actors in Spring Security architecture for authentication and authorization
  • Understanding the relationship between the main actors involved in the basic authentication process and how they relate one to the other
  • Writing your implementations for the primary responsibilities and overriding the default configurations

Spring Boot is the result of a match between the Spring Framework and a build tool (chosen from either Maven or Gradle). Moreover, with the development of recent applications and especially those for microservices, Spring Boot became more and more popular. Spring Boot provides auto-configuration for the project and shortens the time needed for the setup. In this chapter, we start with a first application that uses Spring Security. For the apps that you develop with the Spring Framework, Spring Security is an excellent choice for implementing application-level security.

2.1    Starting with the first project

2.2    Which are the default configurations?

2.3    Overriding the default configurations

2.3.1    Overriding the UserDetailsService component

2.3.2    Overriding the endpoint authorization configuration

2.3.3    Setting the configuration in different ways

2.3.4    Overriding the AuthenticationProvider implementation

2.3.5    Using multiple configuration classes in your project

2.4    Summary