0
我正在关注本教程https://spring.io/guides/tutorials/spring-boot-oauth2/,我设置了自定义auth-server和2个客户端。现在我无法使用客户端注销,我所尝试的是使用客户端X注销并希望我的客户端Z从Facebook或Github中注销。 在这方面的任何帮助,将有助于无法使用客户端应用程序登出
我正在关注本教程https://spring.io/guides/tutorials/spring-boot-oauth2/,我设置了自定义auth-server和2个客户端。现在我无法使用客户端注销,我所尝试的是使用客户端X注销并希望我的客户端Z从Facebook或Github中注销。 在这方面的任何帮助,将有助于无法使用客户端应用程序登出
好吧,我发现,我需要的是打电话给我的客户的前端window.location ="http://localhost:8008/logout";
(Authorozation服务器的URL),并在我的中央授权服务器创建一个自定义logoutSuccessHandler要回客户引荐成功登出后的网址
@Override
public void onLogoutSuccess(HttpServletRequest request,
HttpServletResponse response, Authentication authentication)
throws IOException, ServletException {
if(authentication != null) {
System.out.println(authentication.getName());
}
//perform other required operation
String URL = request.getContextPath();
response.setStatus(HttpStatus.OK.value());
response.sendRedirect(request.getHeader("referer"));
}