@Override protected void configure(HttpSecurity http) throws Exception { http .oauth2Login() .clientRegistrationRepository(this.clientRegistrationRepository) .authorizationEndpoint() .authorizationRequestResolver(this.resolver); super.configure(http); } }
@Override protected void configure(HttpSecurity http) throws Exception { http.authorizeRequests() .antMatchers("/oauth_login", "/loginFailure", "/") .permitAll() .anyRequest() .authenticated() .and() .oauth2Login() .loginPage("/oauth_login") .authorizationEndpoint() .baseUri("/oauth2/authorize-client") .authorizationRequestRepository(authorizationRequestRepository()) .and() .tokenEndpoint() .accessTokenResponseClient(accessTokenResponseClient()) .and() .defaultSuccessUrl("/loginSuccess") .failureUrl("/loginFailure"); }
protected void oauth2Client(HttpSecurity http) throws Exception { http.oauth2Login() .authorizationEndpoint() .authorizationRequestRepository(new HttpCookieOAuth2AuthorizationRequestRepository(properties)).and() .successHandler(oauth2AuthenticationSuccessHandler) .failureHandler(oauth2AuthenticationFailureHandler) .userInfoEndpoint() .oidcUserService(oidcUserService) .userService(oauth2UserService); }