Skip to content

Latest commit

 

History

History
58 lines (33 loc) · 1.76 KB

README.md

File metadata and controls

58 lines (33 loc) · 1.76 KB

Social Login using Spring OAuth2 with Google

Learn how to create a social login with SPRING OAUTH + GOOGLE.

Prerequisites

Run Locally

Set environment variables

The following environment variables must be created, and their values must be taken from the Google OAuth credentials. Do not share these credential values with anyone.

  • GOOGLE_CLIENT_ID = {Client ID}
  • GOOGLE_CLIENT_SECRET = {Client secret}

GoogleOAuth03.png

Execute following commands to build and run the project.

# Build project & install dependencies
./gradlew build

# Run project 
./gradlew bootRun

Testing

Open a web browser and access the URL http://localhost:8080/personalInfo. Once this is completed you will be requested to log in with a Google account.

Step 1

Test01.png

Step 2

Test02.png

Step 3

Test03.png

Finally, by completing the login, information related to the logged user will be displayed. This information is provided by Google and can be used for multiple purposes in your application.

Test04.png