OAuth2 Facebook
Hello, Its Rohan Kadam
Hello All, Hope you are doing well. Today we are going to understand how we can implement OAuth2 Social Login Using Facebook and Spring Boot. Let us start coding.
Before going forward implementing Part 2. I request to go into taking a look in Part 1 — How To Implement OAuth2 Social Login Using Facebook
How To Implement OAuth2 Social Login Using Facebook — Part 1
**Step 1: **Create a Spring Boot Project using Spring initializer.
**Step 2: **Add the following dependencies in your project pom.xml
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-oauth2-client</artifactId>
</dependency>
**Step 3: **Create a Configuration File for implementing OAuth2.
Step 4:- Create Application Yml which will consist of Facebook Configuration.
Step 5:- Create a Rest Controller which consists of two endpoints.
Note:-
Principal Object contains username, email, and profile image depending on scope.
If an error occurs regarding an incorrect redirect Url add the following URL **https://localhost:8080/oauth2/callback/facebook**
Test Endpoints for localhost:-
Top comments (0)