Search in sources :

Example 1 with LogoutHandler

use of org.apache.qpid.server.management.plugin.HttpRequestInteractiveAuthenticator.LogoutHandler in project qpid-broker-j by apache.

the class LogoutServlet method doGet.

@Override
protected void doGet(HttpServletRequest request, HttpServletResponse resp) throws ServletException, IOException {
    HttpSession session = request.getSession(false);
    if (session != null) {
        // Invalidating the session will cause LoginLogoutReporter to log the user logoff.
        session.invalidate();
    }
    LogoutHandler logoutHandler = null;
    for (HttpRequestInteractiveAuthenticator authenticator : AUTHENTICATORS) {
        logoutHandler = authenticator.getLogoutHandler(request, _managementConfiguration);
        if (logoutHandler != null) {
            break;
        }
    }
    if (logoutHandler != null) {
        logoutHandler.handleLogout(resp);
    } else {
        resp.sendRedirect(HttpManagement.DEFAULT_LOGOUT_URL);
    }
}
Also used : HttpSession(javax.servlet.http.HttpSession) HttpRequestInteractiveAuthenticator(org.apache.qpid.server.management.plugin.HttpRequestInteractiveAuthenticator) LogoutHandler(org.apache.qpid.server.management.plugin.HttpRequestInteractiveAuthenticator.LogoutHandler)

Aggregations

HttpSession (javax.servlet.http.HttpSession)1 HttpRequestInteractiveAuthenticator (org.apache.qpid.server.management.plugin.HttpRequestInteractiveAuthenticator)1 LogoutHandler (org.apache.qpid.server.management.plugin.HttpRequestInteractiveAuthenticator.LogoutHandler)1