Java Code Examples for org.springframework.security.web.session.SessionInformationExpiredEvent#getResponse()

The following examples show how to use org.springframework.security.web.session.SessionInformationExpiredEvent#getResponse() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SingleLoginSessionInformationExpiredStrategy.java    From oauth-server with Apache License 2.0 5 votes vote down vote up
@Override
public void onExpiredSessionDetected(SessionInformationExpiredEvent event)
        throws IOException, ServletException {
    HttpServletResponse response = event.getResponse();
    response.setHeader("Content-type", "text/html;charset=UTF-8");
    response.setCharacterEncoding("UTF-8");
    response.getWriter().print("您的账号已在别处登录!要想继续访问,请刷新页面重新登录");
    response.flushBuffer();
}
 
Example 2
Source File: MySessionExpiredStrategy.java    From SpringAll with MIT License 5 votes vote down vote up
@Override
public void onExpiredSessionDetected(SessionInformationExpiredEvent event) throws IOException, ServletException {
    HttpServletResponse response = event.getResponse();
    response.setStatus(HttpStatus.UNAUTHORIZED.value());
    response.setContentType("application/json;charset=utf-8");
    response.getWriter().write("您的账号已经在别的地方登录,当前登录已失效。如果密码遭到泄露,请立即修改密码!");
}
 
Example 3
Source File: MySessionExpiredStrategy.java    From SpringAll with MIT License 5 votes vote down vote up
@Override
public void onExpiredSessionDetected(SessionInformationExpiredEvent event) throws IOException, ServletException {
    HttpServletResponse response = event.getResponse();
    response.setStatus(HttpStatus.UNAUTHORIZED.value());
    response.setContentType("application/json;charset=utf-8");
    response.getWriter().write("您的账号已经在别的地方登录,当前登录已失效。如果密码遭到泄露,请立即修改密码!");
}
 
Example 4
Source File: MySessionExpiredStrategy.java    From SpringAll with MIT License 5 votes vote down vote up
@Override
public void onExpiredSessionDetected(SessionInformationExpiredEvent event) throws IOException, ServletException {
    HttpServletResponse response = event.getResponse();
    response.setStatus(HttpStatus.UNAUTHORIZED.value());
    response.setContentType("application/json;charset=utf-8");
    response.getWriter().write("您的账号已经在别的地方登录,当前登录已失效。如果密码遭到泄露,请立即修改密码!");
}
 
Example 5
Source File: NotAuthorizedSessionInformationExpiredStrategy.java    From govpay with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onExpiredSessionDetected(SessionInformationExpiredEvent event) throws IOException, ServletException {
	HttpServletResponse response = event.getResponse();
	Response payload = CodiceEccezione.AUTENTICAZIONE.toFaultResponse("Sessione Scaduta");
	AbstractBasicAuthenticationEntryPoint.fillResponse(response, payload, this.timeZone);
}
 
Example 6
Source File: NotAuthorizedSessionInformationExpiredStrategy.java    From govpay with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onExpiredSessionDetected(SessionInformationExpiredEvent event) throws IOException, ServletException {
	HttpServletResponse response = event.getResponse();
	Response payload = FaultCode.AUTORIZZAZIONE.toFaultResponse("Sessione Scaduta");
	AbstractBasicAuthenticationEntryPoint.fillResponse(response, payload, this.timeZone);
}