我的配置是:
@Configuration
@EnableWebSecurity(debug = false)
@EnableGlobalMethodSecurity(securedEnabled = true)
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
private SaveNewOidcUserService saveNewOidcUserService;
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.anyRequest().authenticated()
.and()
.logout()
.clearAuthentication(true)
.invalidateHttpSession(true)
.deleteCookies("JSESSIONID")
.logoutUrl("/logout")
.logoutSuccessUrl("/")
.permitAll()
.and()
.oauth2Login()
.userInfoEndpoint()
.oidcUserService(saveNewOidcUserService);
}
}
版本:
spring-security-oauth2-client 5.3.2.RELEASE
spring-boot-starter-security 2.3.0.RELEASE
我通过谷歌登录我的应用程序,注销我的应用程序后,我在火狐控制台日志中看到有GET到/login页面,所以如果我仍然登录谷歌,我的安全应用程序的内容会显示(因为自动登录),但应该要求通过谷歌登录屏幕选择帐户等。
如何强制注销后不自动登录?
发布于 2020-06-12 16:24:12
我加完后就解决了
.exceptionHandling()
.defaultAuthenticationEntryPointFor(
customAuthEP(),
new AntPathRequestMatcher("/**")
)
https://stackoverflow.com/questions/62332377
复制相似问题