2017-04-17 105 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")); 
}