admin 管理员组文章数量: 1086019
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();
}
本文标签: javaSpring security OAUTHInvalid credentialsStack Overflow
版权声明:本文标题:java - Spring security OAUTH - Invalid credentials - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/p/1744071192a2528515.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论