Hello All, Its Rohan Kadam
In previous part 1, we looked into how to create projects and keys and credentials. Let us look into code for implementing OAuth Login in Spring boot
Follow the below article for Google Configuration.
How to implement OAuth2 Login Using Google — Part 1
<dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-oauth2-client</artifactId> </dependency>
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/google**