별다른 설정을 하지 않으면 스프링 시큐리티 자동 초기화에 의해 기본값으로 OAuth2LoginConfigurer의 초기화 과정이 진행된다.
img.png
img.png
init 과정에서 먼저 OAuth2LoginAuthenticationFilter가 생성된다.
이 필터는 /login/oauth2/code/*({registrationId})로 요청이 올 때 동작한다.
OAuth2LoginAuthenticationFilter는 요청에 따라 AuthenticationProvider의 구현체 중 하나인 OAuth2LoginAuthenicationProvider 또는 OidcAuthorizationCodeAuthenticationProvider 에게 요청을 위임한다.
OAuth2LoginAuthenicationProvider : OAuth 2.0 인가 서버로부터 사용자 정보를 가져오는 Provider
OidcAuthorizationCodeAuthenticationProvider : OpenID Connect 를 사용해 사용자 정보를 가져오는 Provider