2017-04-17 7 views
0

나는이 튜토리얼을 https://spring.io/guides/tutorials/spring-boot-oauth2/에두고 있으며 사용자 정의 인증 서버와 2 개의 클라이언트를 설정했습니다. 이제 클라이언트를 사용하여 로그 아웃 할 수 없습니다. 클라이언트 X를 사용하여 로그 아웃하고 내 클라이언트 Z가 페이스 북 또는 Github에서 로그 아웃되도록하려고합니다. 이 점에서 어떤 도움이 도움이 될 것입니다클라이언트 응용 프로그램을 사용하여 로그 아웃 할 수 없습니다.

답변

0

내가 내가 필요하면 내 고객의 프론트 엔드에서 window.location ="http://localhost:8008/logout"; (Authorozation 서버의 URL)를 호출하고 클라이언트 리퍼러로 돌아 가야 내 중앙 인증 서버에서 사용자 지정 logoutSuccessHandler를 만들 것을 발견 좋아 성공 로그 아웃 후 URL

@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")); 
} 
관련 문제