How To Implement OAuth2 Social Login(Single Sign-On)Using Facebook & Spring Boot — Part 2

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 P…


This content originally appeared on DEV Community and was authored by ROHAN KADAM

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.

**Social Login Using Facebook and Spring Boot**

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.

Spring Initializr

**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:-

  1. Principal Object contains username, email, and profile image depending on scope.

  2. If an error occurs regarding an incorrect redirect Url add the following URL **https://localhost:8080/oauth2/callback/facebook**

Test Endpoints for localhost:-

**http://localhost:8080/oauth2/authorize/facebook?redirect_uri=http://localhost:8080/oauth2/callback/facebook**

Thank You, Viewers


This content originally appeared on DEV Community and was authored by ROHAN KADAM


Print Share Comment Cite Upload Translate Updates
APA

ROHAN KADAM | Sciencx (2021-11-27T16:29:18+00:00) How To Implement OAuth2 Social Login(Single Sign-On)Using Facebook & Spring Boot — Part 2. Retrieved from https://www.scien.cx/2021/11/27/how-to-implement-oauth2-social-loginsingle-sign-onusing-facebook-spring-boot-part-2/

MLA
" » How To Implement OAuth2 Social Login(Single Sign-On)Using Facebook & Spring Boot — Part 2." ROHAN KADAM | Sciencx - Saturday November 27, 2021, https://www.scien.cx/2021/11/27/how-to-implement-oauth2-social-loginsingle-sign-onusing-facebook-spring-boot-part-2/
HARVARD
ROHAN KADAM | Sciencx Saturday November 27, 2021 » How To Implement OAuth2 Social Login(Single Sign-On)Using Facebook & Spring Boot — Part 2., viewed ,<https://www.scien.cx/2021/11/27/how-to-implement-oauth2-social-loginsingle-sign-onusing-facebook-spring-boot-part-2/>
VANCOUVER
ROHAN KADAM | Sciencx - » How To Implement OAuth2 Social Login(Single Sign-On)Using Facebook & Spring Boot — Part 2. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/11/27/how-to-implement-oauth2-social-loginsingle-sign-onusing-facebook-spring-boot-part-2/
CHICAGO
" » How To Implement OAuth2 Social Login(Single Sign-On)Using Facebook & Spring Boot — Part 2." ROHAN KADAM | Sciencx - Accessed . https://www.scien.cx/2021/11/27/how-to-implement-oauth2-social-loginsingle-sign-onusing-facebook-spring-boot-part-2/
IEEE
" » How To Implement OAuth2 Social Login(Single Sign-On)Using Facebook & Spring Boot — Part 2." ROHAN KADAM | Sciencx [Online]. Available: https://www.scien.cx/2021/11/27/how-to-implement-oauth2-social-loginsingle-sign-onusing-facebook-spring-boot-part-2/. [Accessed: ]
rf:citation
» How To Implement OAuth2 Social Login(Single Sign-On)Using Facebook & Spring Boot — Part 2 | ROHAN KADAM | Sciencx | https://www.scien.cx/2021/11/27/how-to-implement-oauth2-social-loginsingle-sign-onusing-facebook-spring-boot-part-2/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.