To install Spring Security, let's add the following dependency to pom.xml:
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId></dependency>...<dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-test</artifactId> <scope>test</scope></dependency>
We add spring-security-test so that we can use it in the unit test to make sure the endpoints of our application have permission configured correctly. In order to see what Spring Security does, let's turn on the debug-level logging by adding the following configuration to src/main/resources/application.properties:
logging.level.org.springframework.security=DEBUG
Now, let's add ...