2017-04-17 52 views

回答

0

好吧,我发现,我需要的是打电话给我的客户的前端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")); 
} 
相关问题