我已经使用@ EnableOath2Sso批注成功与OIDC提供程序集成了客户端。但是,对于注销,我有些挣扎。提供程序需要idToken作为注销请求的参数。我的设置是:
@EnableOAuth2Sso
@Configuration
public class OpenIDConnectConfig extends WebSecurityConfigurerAdapter {
public void configure(HttpSecurity http) throws Exception {
http.antMatcher("/**").
authorizeRequests().
anyRequest().authenticated().and().
logout().logoutSuccessHandler(this::onLogout).and().
csrf().csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse());
}
public void onLogout(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException {
}
如何通过onLogout方法访问idToken,以便可以重定向到OIDC提供程序的正确URL?