Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 730 Bytes

File metadata and controls

29 lines (21 loc) · 730 Bytes

OAuth2 Project

- using the OAuth2 via Google O-auth2 and Github OAuth2
- third party will access info from google about users to the servers

Implementing OAuth2

@Configuration
@EnableWebSecurity
public class SecurityConfig {
    
    @Bean 
    public SecurityFilterChain defauSecurityFilterChain(HttpSecurity http) throws Exception{
        http.authorizeHttpRequests(auth -> auth.anyRequest().authenticated())
                .oauth2Login(Customizer.withDefaults());
                 
        return http.build();
    }
}