Example usage for org.springframework.security.web.authentication AuthenticationSuccessHandler onAuthenticationSuccess

List of usage examples for org.springframework.security.web.authentication AuthenticationSuccessHandler onAuthenticationSuccess

Introduction

In this page you can find the example usage for org.springframework.security.web.authentication AuthenticationSuccessHandler onAuthenticationSuccess.

Prototype

void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response,
        Authentication authentication) throws IOException, ServletException;

Source Link

Document

Called when a user has been successfully authenticated.

Usage

From source file:sample.session.CompositeAuthenticationSuccessHandler.java

public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response,
        Authentication authentication) throws IOException, ServletException {
    for (AuthenticationSuccessHandler handler : handlers) {
        handler.onAuthenticationSuccess(request, response, authentication);
    }//from  w ww.  j  a  v  a 2s.  c  o m
}

From source file:org.bibsonomy.webapp.util.CookieLogic.java

/**
 * After the user has been successfully authenticated (or registered), this
 * method should be called.//www . ja v a  2s . c  om
 * 
 * @param handler
 * @param authentication
 */
public void onAuthenticationSuccess(final AuthenticationSuccessHandler handler,
        final Authentication authentication) {
    try {

        handler.onAuthenticationSuccess(this.requestLogic.getRequest(), this.responseLogic.getResponse(),
                authentication);
    } catch (IOException e) {
        throw new AuthenticationServiceException("Could not authenticate user " + authentication.getName(), e);
    } catch (ServletException e) {
        throw new AuthenticationServiceException("Could not authenticate user " + authentication.getName(), e);
    }
}