2017-04-17 4 views
0

https://spring.io/guides/tutorials/spring-boot-oauth2/でこのチュートリアルを実行しており、カスタム認証サーバーと2クライアントを設定しました。今私はクライアントを使用してログアウトすることができません、私が試みているのはクライアントXを使用してログアウトし、クライアントZをFacebookやGithubからログアウトさせることです。 この点で任意のヘルプは参考になりますクライアントアプリケーションを使用してログアウトできません

答えて

0

私は私が必要なことは、私のクライアントのフロントエンドからwindow.location ="http://localhost:8008/logout";(AuthorozationサーバーのURL)を呼び出し、クライアントのリファラに戻って得るために、私の中央認証サーバーでカスタムlogoutSuccessHandlerを作成することだったことが判明[OK]を成功ログアウト後の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")); 
} 
関連する問題