All the services we have created up until ;now are unsecured. A consumer does not need to provide any credentials to access these services. However, all services in the real world are usually secured.
In this section, we will discuss two ways of authenticating REST services:
- Basic authentication
- OAuth 2.0 authentication
We will implement these two types of authentication with Spring Security.
Spring Boot provides a starter for Spring Security using ;spring-boot-starter-security. We will start with adding Spring Security starter to our pom.xml file.