Struggling with this error, while I trying login via OAUTH GOOGLE.
My securityfilterchian
@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
//http.cors(cors -> cors.configurationSource(corsConfigurationSource()));
http.cors(cors -> cors.disable());
http.csrf(csrf ->csrf.ignoringRequestMatchers("/oauth/*", "/auth/user"));
http.authorizeHttpRequests(request -> request.requestMatchers("/oauth/*","/auth/user").permitAll().anyRequest().authenticated());
http.oauth2Login(login -> login.successHandler(((request, response, authentication) -> response.sendRedirect("/auth/user"))));
return http.build();
}
in application.properties
spring.security.oauth2.client.registration.google.client-id= my client id
spring.security.oauth2.client.registration.google.client-secret= my client secret
Is there something else what I have to configurate ?
EDIT (SOLVED)
reason of 'Invalid credentials' was my sessions, which was 'null'. Reason of this null was automatically set up 'sameSite' cookies by this @Bean
@Bean
public CookieSameSiteSupplier applicationCookieSameSiteSupplier() {
return CookieSameSiteSupplier.ofStrict();
}
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744071191a4553570.html
评论列表(0条)