LAB-Logging in With Google Oauth: Step 1 - User Registration
LAB-Logging in With Google Oauth: Step 1 - User Registration
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-oauth2-client</artifactId>
</dependency>
Go to https://console.developers.google.com/
spring:
security:
oauth2:
client:
registration:
google:
client-id: <<client-id>>
client-secret: <<client-secret>>
Open login.html under templates folder and observe how we have added link for Google
Login
That’s all !!
Now give a request to http://localhost:8080/hello so that you will be redirected to
login page.
Open http://localhost:8080/h2-console and observe that the user details are added to
Users table.