Java 如何从spring控制器类重定向到saml注销

Java 如何从spring控制器类重定向到saml注销,java,spring-boot,spring-security,saml-2.0,Java,Spring Boot,Spring Security,Saml 2.0,在我们的spring boot应用程序中,当控制器类中出现未经授权的(401)异常时,我想重定向到saml/logout response.sendRedirect("/saml/logout"); 我在日志中看到了这个映射 DefaultSecurityFilterChain - Creating filter chain: Ant [pattern='/saml/logout/**'], [org.springframework.security.saml.SAMLLogoutFilter

在我们的spring boot应用程序中,当控制器类中出现未经授权的(401)异常时,我想重定向到saml/logout

response.sendRedirect("/saml/logout");
我在日志中看到了这个映射

DefaultSecurityFilterChain - Creating filter chain: Ant [pattern='/saml/logout/**'], [org.springframework.security.saml.SAMLLogoutFilter@6e836dbc]
请建议我怎么做