Followed by Microservice based design pattern using OAuth 2.0 and OpenID Connect to authenticate in the Google and get information to user.
Chandra
- Maven;
- Spring Boot;
- Spring Web;
- Spring Security;
- OAuth2 client;
- HTML, CSS.
- Go to https://console.developers.google.com and login with your Google account (this will be the developer account and the email of this account will be published when someone tries to authenticate with the Google application).
- If you don't have a project create a new one and then click into the project.
- In the menu "API manager" on the left side select "Credentials" --> "Create credentials" --> "OAuth client ID".
- Application Type -> "Web Application",
- Authorized Javascript Origins -> " ",
- Authorized Redirect URI -> http://localhost:8181/google/login
- Copy the client ID and client Secret and update the
application.yml
@Configuration public class securityconfig extends WebSecurityConfigurerAdapter{
protected void configure(HttpSecurity httpSecurity) throws Exception{
httpSecurity.authorizeRequests()
.anyRequest().authenticated()
.and().oauth2Login();
mvn spring-boot:run
If you get user credetial then you used