javax.servlet.http.HttpServletRequest ClassNotFoundException
Adding a new Facebook login to an existing form-login app.
We will use the Spring Social support to interact with Facebook and keep things clean and simple.
It leverages facebook OAuth2 to login.
Java 17
spring boot 3.0.1
spring security 6
thymeleaf-extras-springsecurity6
jakarta.persistence-api
https://github.com/chuangtc/spring-boot-3.0-security-social-login
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-facebook</artifactId>
<version>${spring.social.facebook.version}</version>
</dependency>
Next, let's configure Facebook properties in our application.properties:
spring.social.facebook.appId=YOUR_APP_ID
spring.social.facebook.appSecret=YOUR_APP_SECRET
In this quick article, we learned how to use spring-social-facebook to implement a secondary authentication flow for our application.